I needed the full email address to be stored as the username for a site so I patched the lines that manipulate the $namenew.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1440626-use-original-email-as-username-1.patch | 961 bytes | mynameiscorey |
I needed the full email address to be stored as the username for a site so I patched the lines that manipulate the $namenew.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1440626-use-original-email-as-username-1.patch | 961 bytes | mynameiscorey |
Comments
Comment #1
mynameiscorey commentedattaching patch
Comment #2
tassoman commentedMaybe that could be included as feature, then enabled in administration settings by flag?
Comment #3
archimedes commentedThis feature would be handy. What's the status on this patch for D7?
Comment #4
raggax2 commentedThis 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.
Comment #5
gregglesThis 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.
Comment #6
dhineshr commentedHi, i've changed the username by using hook_username_alter.