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.

Comments

mgorla’s picture

Version: 5.x-2.1 » 6.x-1.1

subscribe

Christopher Herberte’s picture

I'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.

mdowsett’s picture

Version: 6.x-1.x-dev » 6.x-1.1

I 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!

Christopher Herberte’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
asak’s picture

Version: 6.x-1.1 » 6.x-1.x-dev

Just 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:

/** 
 * function email_registration_settings() {
 *  return system_settings_form($form);
 * }
 */

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.

asak’s picture

Still 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...?

mikeryan’s picture

Status: Active » Needs review
StatusFileSize
new3.01 KB

The 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?

Christopher Herberte’s picture

Mike, I love the idea. Patch failed?

mikeryan’s picture

StatusFileSize
new2.78 KB

Hmm, try this one...

Christopher Herberte’s picture

Still she no go. I'll apply the changes manually and commit it when I get a minute

andypost’s picture

Suppose there's not clear solution so let's go to Hall of Shame

greggles’s picture

Title: other formats to generated user name » provide a hook so other modules can help generate the user name
Status: Needs review » Fixed

Thanks 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

aschiwi’s picture

Status: Closed (fixed) » Active

So 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.

greggles’s picture

Status: Active » Closed (fixed)

This is a hook and you have to write code to implement that hook to get it to work. The hook is:

module_invoke_all('email_registration_name', $edit, $account);

So your code would have to be something like:


function mymodule_email_registration_name($edit, $account) {
  return md5($account->mail);
}