Username on account creation

4 replies [Last post]
julient
Offline
Joined: 05/07/2011
Status: 
Answered

Hi,

 

In checkout, when the user is entering his email, a username is created for him and an email for his password is sent.

The username is built on the email part before the @.

However, I noticed that when emails with identical start are used, the script is creating username by duplicating words.

 

I mean, one of the most common email is info@domain.com.

1st user with info@domain1.com gets username info.

2nd user with info@domain2.com gets username infoinfo1.

3rd user with info@domain3.com gets username infoinfo1info2.

and so on

so you can imagine how crazy and long it gets after the 10th user to register with an info@... email.

What can be done ?

 

Thanks,

Julien

Leighton Whiting
Offline
Joined: 06/02/2009
Thanks for letting me know, I

Thanks for letting me know, I tracked this down and fixed it.

Sincerely,

Leighton Whiting

julient
Offline
Joined: 05/07/2011
Hi Leighton,   Can you please

Hi Leighton,

 

Can you please tell me what code changes I should make?

My site is live and already heavily customised that I cannot upgrade to your newest release.

So a patch or info on what to edit would be appreciated.

 

Thanks,

Julien

 

Leighton Whiting
Offline
Joined: 06/02/2009
Certainly, it is a very small

Certainly, it is a very small fix. In the ms_core_create_username() function in the ms_core.module file, simply change the following line:

  1. $temp_name .= $name . $count;

to:

  1. $temp_name = $name . $count;

All it did was remove the period before the = sign.

Sincerely,

Leighton Whiting

julient
Offline
Joined: 05/07/2011
That's an easy change

That's an easy change :)

 

Thanks.

Twitter Feed