I don't like the way this module generates the user's username. I'd like it to be generated from the profile first and last names as set up in the user registration form.
I mainly want this as the confirmation email users get have a garbled system-generated user name that they find confusing....even tho their user name is actually their pre-@ part of their email address.
I tried using this module along with the auto_username module but it seems that this module still wins the battle in generating the user name.
I like how auto_username allows you to define how you want to name the username by seeing all profile fields in the admin settings. I'd even be happy if this module can be altered in the code to generate the user name by manually entering in the profile field names.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | email_registration.module.patch | 2.78 KB | mikeryan |
| #7 | email_registration.module.patch | 3.01 KB | mikeryan |
Comments
Comment #1
mgorla commentedsubscribe
Comment #2
Christopher Herberte commentedI'm starting a new project which requires this type of functionality, email_registration will get some lovin' in this department over the next few weeks. Expect new release soon, need testers.
Comment #3
mdowsett commentedI was also just recently pointed to the Realname module but it isn't really suiting my needs (there seems to be some issues).
I look forward to your updates!
Comment #4
Christopher Herberte commentedComment #5
asak commentedJust downloaded the latest dev release (from 1 hour after your post) - but i can't seem to find the content_profile and token support mentioned.
In the module file, I see this:
And no instance of content_profile anywhere in the code, just:
if (module_exists('profile') && is_array($form['account'])) {..Do i have the right version? This is a great module which fits perfectly for a current project, i'll gladly help test this out.
Comment #6
asak commentedStill can't get this working...
Users are getting in their emails a strange username - but on the admin pages i see the correct pre-@ usernames.
Solvable...?
Comment #7
mikeryanThe attached patch provides hook_email_registration_name($edit, $account) - by implementing this hook in a module, you can replace email_registration's default username generation with whatever you like. This operates on a case-by-case basis - in my case, I'm migrating to Drupal from a system which used email for logging in, but also had usernames - only for users who had commented. So, with this implementation, I can return the existing username when it exists, and otherwise return NULL and allow email_registration to generate a username for the rest.
Comments?
Comment #8
Christopher Herberte commentedMike, I love the idea. Patch failed?
Comment #9
mikeryanHmm, try this one...
Comment #10
Christopher Herberte commentedStill she no go. I'll apply the changes manually and commit it when I get a minute
Comment #11
andypostSuppose there's not clear solution so let's go to Hall of Shame
Comment #12
gregglesThanks mikeryan, Chris.
I've now committed this to the 6.x branch: http://drupal.org/cvs?commit=223514
@andypost - I don't understand why you would post that message in this thread. I like the so called "hall of shame" but this module's existence there is not for shame - it doesn't duplicate functionality - and this issue has nothing to do with duplication (aside from the misplaced messages by asak). Poor form, sir.
Comment #14
aschiwi commentedSo how exactly does this work now?
The auto_username module only has a 5.x release. I have also been running realname module which changes the display of the username to whatever profile fields you choose, but the actual username stays the same.
Comment #15
gregglesThis is a hook and you have to write code to implement that hook to get it to work. The hook is:
So your code would have to be something like: