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.

Username max length upgrade dilemmas

October 01, 2010 12:03pm

Subscribe [5]
  • #1 / Oct 01, 2010 12:03pm

    JayJ

    10 posts

    Hi there,

    I look after a website using EE, and after a recent merger with another company we brought everything under one EE roof. The base EE site was developed some 2 years before I joined the company and it was done with 1.6.4. I thought seeing as we were going through all the pain of the merger, now would be a good time to upgrade to the latest version - which at the time was 1.6.9.

    As I’m not very PHP/MySQL/EE savvy yet, we contracted the upgrade of the site from 164 to 169 out to someone who was. This all went fine.

    Anyway, we recently went live, and today I got someone trying to register on the site and getting an error message saying that their username (email address) exceeded the 32 char limit. I thought to myself, this can’t be - our former company name was 26 chars itself, and all our staff registered fine - so this got thinking that the original developer must have tinkered with the core code, and this got wiped out when the site was upgraded to 169.

    After reading through your site, I found the core file I needed to look in, and checked both the new core.validate.php and the old one, and the original developer had done:

    if (strlen($this->username) > 150) // originally 32
    {
        $this->errors[] = $LANG->line('username_password_too_long');
    }

    He did leave some notes saying that he also modded exp_members.username from 50 to 150 and also modded cp.members.php line 2496 to allow longer email in cp login as per - http://ellislab.com/forums/viewthread/55257/

    I looked in cp.members.php and at that line, it does indeed have 150 instead of 32 which the new core file has.

    The new site went live a few weeks ago now and so we’ve had two weeks worth of registrants - presumably joining and being restricted to 32 chars, whereas we have an existing database that has thousands of members who had the 150 restriction.

    My question is, and I’m sorry I’ve taken a while to get to it, but can I just go into those two files and change the number from 32 to 150 without it messing up anything? If those core files suddenly change to 150, will it mess up the last two weeks registrant’s records? I really don’t know much about database and how everything is referenced and used by EE.

    The developer says in his notes that he modded exp.members.username - where is this? Is that a table in the database itself? As we are using the existing database, will I need to make changes? Or perhaps just changes to the last two week’s of member records?

    I have to say I’m a bit lost, so any guidance on where I should be looking to track down how I can up the limit back up to 150 would be appreciated.

    Cheers, Jay


    ps. We no longer have contact with the existing developer, and the one we recently used to do the upgrades is on vacation - hence my panic.

  • #2 / Oct 01, 2010 11:50pm

    Brandon Jones

    5500 posts

    Hi Jay,

    No need to panic. Though EE wasn’t specifically designed to handle email addresses in the username field, as long as you re-make those same core modifications to EE’s files after each upgrade you should be fine.

    As far as the database goes, your developer would have changed the allowed length of the “username” column in the exp_members table. That change probably won’t need to be made again.

    The only possibly tricky bit is going to come when it’s time to move to EE 2.x, but I gather that is not in the cards any time soon. Hope this helps.

  • #3 / Oct 04, 2010 7:46am

    JayJ

    10 posts

    I’ve made the changes to the PHP files and fingers crossed.

    Thank you for the guidance.

    Cheers, Jay

  • #4 / Oct 04, 2010 4:03pm

    Ingmar

    29245 posts

    Very good. Let us know how it goes, please.

  • #5 / Oct 25, 2010 4:52pm

    Fatfree

    40 posts

    I am running into the same problem but I am already running 2.1.0 is there a similar solution?

    Thank you

  • #6 / Oct 26, 2010 10:13am

    Sue Crocker

    26054 posts

    Hi, dhayes. Could you go into more detail? Did you have changes made to the core EE files?

  • #7 / Oct 26, 2010 10:29am

    Fatfree

    40 posts

    Thank you for the response. I’m running ee 2.1 and using the user module. I realized that while I can’t register a new user through the CP with a username that is more than 32 characters I can register a smaller username and then edit that username after the initial registration. So I’m ok now.

  • #8 / Oct 26, 2010 6:49pm

    Sue Crocker

    26054 posts

    dhayes, just a warning.. you may want to add the 32 character username in another field just in case you run into troubles down the line. But in the mean time, don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases