ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

32 maximum character length for username

November 03, 2010 12:35am

Subscribe [6]
  • #1 / Nov 03, 2010 12:35am

    Danny Veiga

    58 posts

    I’m running EE 2.1 and I’m not able to register any members that have more than 32 characters in their username. I tried doing this by physically going into cPanel and then registering the member manually.

    Where do I adjust the settings to increase the maximum number of character within EE? I’ve tried searching for both solutions but the recent suggestions are almost 2 years old - and the files it mentions don’t exist in EE 2.X

    Thanks,

    Moved to CodeShare Corner by Moderator

  • #2 / Nov 03, 2010 1:26pm

    Sue Crocker

    26054 posts

    Hi, Danny. Making that change would involve hacking EE core files. So I’m going to move this over to the CodeShare Corner for additional community support.

    This would also make a great Feature Request. Is there a particular business reason you need 150 characters?

  • #3 / Nov 09, 2010 9:51pm

    Danny Veiga

    58 posts

    Anyone have suggestions? Not sure what you mean by more than 150 characters, the limitation I’m having is 32 characters… the reason is that we are using email addresses for usernames instead of regular usernames.

    Thanks, any help is appreciated.

  • #4 / Dec 03, 2010 11:39am

    box-head

    177 posts

    Hi Danny,

    Did you have any luck with this? I’m looking to use emails as usernames too.
    I am getting an error too.
    “The name you submitted may only contain alpha-numeric characters, underscores, and dashes”

    Does this mean we can’t use ‘@’ in a username?

    Thanks

  • #5 / Feb 08, 2011 11:09am

    sharon-b

    7 posts

    Any luck with this?

  • #6 / Mar 12, 2011 3:52pm

    Danny Veiga

    58 posts

    I’ve come across another thread that said to modify validate.php in system/expressionengine/libraries but the default was already at 50, no matter what this number changes to it doesn’t change anything. I’ve also looked in the database tables and the value’s are set to 50.

    This occurs when I try to register a user manually in the backend.

  • #7 / Mar 12, 2011 4:52pm

    Danny Veiga

    58 posts

    I noticed on an archived thread, that Robin posted a fix for the username but that was prior to ee2.0.

    Ah- the backend control panel member area?  Is handled by system/cp files- in the case of registering a new member through the backend, it’s handled by system/cp/cp.member.php- the new_member_profile_form() function.  Around line 2493, it looks like:

    $r .= $DSP->itemgroup(
                                    $DSP->required().NBS.$LANG->line('username', 'username'),
                                    $DSP->input_text('username', '', '35', '32', 'input', '300px')

    Anyone have a similar fix for adding users through the CP on 2.x? I think this is where we’re having an issue with and cant find a solution.

  • #8 / Mar 12, 2011 5:57pm

    Rick Jolly

    729 posts

    Three relevent things for the username:

    1. text input maxlength is set to 32
    2. EE username validation disallows valid email characters
    3. exp_members database table username field size is set to max 50 characters.

    The proper way to handle all these thing is to create an extension. During activation, the extension would alter the exp_members table to increase the size of the username field. The extension would use the member_member_register_start hook to circumvent EE registration and thereby prevent username validation. The extension would also use the cp_js_end hook to allow some javascript to increase the maxlength of the username text input.

    Of course, you could just hack EE files and the database to do all these things.

  • #9 / Mar 14, 2011 4:21pm

    Danny Veiga

    58 posts

    Finally figured out a hack if anyone wants to do it - takes a quick minute to do:

    1: Edit DB table exp_members - change username’s type to the # of chars you’re wanting.
    2: Edit /system/expressionengine/libraries/EE_Form_Validation.php line #134 to the same #. <—This was the tricker.. I couldn’t locate the right file but finally did.

    Just take some pre-caution like backing up that table in case of anything.

  • #10 / Aug 08, 2011 11:05am

    Jan Vantomme

    18 posts

    I’ve edited EE_Form_Validation.php and changed the database table but I’m still not able to register people with an email address longer than 50 characters. Is there any other place EE checks for the length of the username or email? I’m using the Simple Registration addon from Addon Bakery to handle registrations. (http://www.addonbakery.com/docs/expressionengine/Simple_Registration_for_ExpressionEngine.html)

  • #11 / Aug 08, 2011 12:25pm

    Jan Vantomme

    18 posts

    I was able to fix the problem by also changing the 50 character limit in /system/expressionengine/libaries/Validation.php. Didn’t know that EE checked username length in two places.

  • #12 / Aug 08, 2011 2:46pm

    Danny Veiga

    58 posts

    Thanks Jan, I haven’t had to modify the username length anymore - it was just that 1 client we worked on.

    What version of EE are you using, so future people can know what to look for?

  • #13 / Aug 08, 2011 2:54pm

    Jan Vantomme

    18 posts

    That site runs on EE 2.1.3, but I think the trick should work on all newer versions too.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases