Email / Username Character Limit
Posted: 03 April 2008 02:03 AM   [ Ignore ]
Newbie
Rank
Total Posts:  8
Joined  2007-11-25

Hi there,

I’ve run into a problem with the User Module.

I’ve set up the preferences to use the email address as the username of registered members. This is all working fine, except that there seems to be a 32 character limit on usernames. As such, if someone enters a moderately long email address (as seems to happen very frequently), they are informed that “Usernames cannot be over 32 characters in length”.

How do I get around this limitation?

Thanks,
Stephen

Profile
 
 
Posted: 03 April 2008 05:21 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Stephen,

You’ll want to hack a bit. Simple stuff and as long as you keep track of the changes you make, you can pass the changes across from EE version to EE version.

Change the username length in core.validate.php. Look for a function called “validate_username()”. Search for 32 within that. You’ll find the setting for the username length. If you want the username longer than 50 chars, you also need to alter the database column “username” in exp_members from 50 to something more.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 03 April 2008 10:26 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  8
Joined  2007-11-25

All done, and working as promised. Thanks Mitchell.

Stephen

Profile
 
 
Posted: 03 April 2008 11:40 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

All that means is that you’re one of the smart kids.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 03 April 2008 03:13 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  8
Joined  2007-11-25

*Adds plaudit to CV* wink

Profile
 
 
Posted: 06 October 2008 01:56 PM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  6
Joined  2007-04-21

I have exactly the same problem. However, it is almost a year later. Is there a smarter solution available nowadays? I’m just in a test situation with 8 users, and I immediately have this problem. I can assume nearly anyone seriously using this module has this problem.

What would be the implications on EE upgrades etc? Are all those e-mail entries truncated again? And is the core function reset to 32?

Profile
 
 
Posted: 07 October 2008 07:22 AM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3257
Joined  2006-10-18
Erwin - 06 October 2008 01:56 PM

I have exactly the same problem. However, it is almost a year later. Is there a smarter solution available nowadays? I’m just in a test situation with 8 users, and I immediately have this problem. I can assume nearly anyone seriously using this module has this problem.

We have it on the list to address. I’m not exactly sure if we can fix or override this issue because it takes place in some EE files, but we’ll see. smile

Erwin - 06 October 2008 01:56 PM

What would be the implications on EE upgrades etc? Are all those e-mail entries truncated again? And is the core function reset to 32?

The above hack is something you’d definately need to keep reapplying with new upgrades of EE in the meantime. wink

 Signature 
Profile