Username contains illegal characters! problem

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
zolee1
New Member
New Member
Posts: 3
Joined: Thu Sep 20, 2007 4:58 pm

Username contains illegal characters! problem

Post by zolee1 »

Hi,

I tried to install version 1.1.2. On the second page I keep getting the "Username contains illegal characters!" message. The username I am tiring to use is amvir2_cmsuser
I assume based on the regex in CMSInstaller.class.php that the _ is the problem, but not sure why. It should be a legal character on a database user name.

I am using cPanel, and it automatically ads a prefix amvir2_ to the username.

I tried changing the regex to the following /^[a-zA-Z][a-zA-Z0-9\_]+$/ but it did not help.
Is there another file I would need to change?
Any help would be appriciated.

Thanks,

Z-
chrisl
Forum Members
Forum Members
Posts: 57
Joined: Fri Dec 30, 2005 10:08 am

Re: Username contains illegal characters! problem

Post by chrisl »

You could try

"/^[a-zA-Z0-9_]+$/"

this is untried and not tested but should work although I'm not sure if there would be any subsequent problems.
zolee1
New Member
New Member
Posts: 3
Joined: Thu Sep 20, 2007 4:58 pm

Re: Username contains illegal characters! problem

Post by zolee1 »

Thanks,

It turned out that mine regex was correct, I just didn't realize that I did not upload the modified file, becuase I installed it through SSH, and I didn't change the user privilege.

Anyhow, I would recommend changing the CMSInstaller.class.php line 163 to

Code: Select all

else if ( !preg_match( "/^[a-zA-Z][a-zA-Z0-9\_]+$/", trim($_POST['adminusername']) ) )
so it accepts the _ character.
Locked

Return to “[locked] Installation, Setup and Upgrade”