I needed the full email address to be stored as the username for a site so I patched the lines that manipulate the $namenew.

Comments

mynameiscorey’s picture

attaching patch

tassoman’s picture

Maybe that could be included as feature, then enabled in administration settings by flag?

archimedes’s picture

This feature would be handy. What's the status on this patch for D7?

raggax2’s picture

Status: Needs review » Needs work

This module does include a hook to generate usernames: hook_email_registration_name.

If you wanted to use the email address as the username, couldn't you implement this hook? I think that the problem with adding an admin settings flag is it would compete with the hook for behavior.

greggles’s picture

Status: Needs work » Closed (won't fix)

This is probably not a great idea. It's very easy for a module to leak the usernames of your site in a way that can be enumerated (i.e. by visiting user/1 and then user/2 and then...I can get all the usernames of your site). If a site does leak usernames AND those names are emails then the site has leaked all email addresses which is a pretty big problem from the perspective of privacy and spam.

If someone DOES want to do this, see comment #15 on #330925: Optionally update user names when a user is edited as an example of how to do it in a site specific module.

dhineshr’s picture

Issue summary: View changes

Hi, i've changed the username by using hook_username_alter.