Page 1 of 1

username lengths

Posted: Mon Sep 17, 2007 8:53 am
by redfeather
Okay, I was told I should post this question here...

Is there a way to decrease the required username length? Specifically, I'd like to be able to allow usernames that are only one or two characters in length. We're using our IRC Services database to authenticate users, and while users with nicknames that are only one or two chars in length can login in, they can't update site details. Instead, they receive an error asking them to use a username that is greaters than 2 chars.

I'm fairly certain I'll have to muck around in the source to achieve this (if it is possible), so where should I look?

Any help is much appreciated!

Re: username lengths

Posted: Mon Sep 17, 2007 2:41 pm
by sviftrup
Hi
this is where you change it. I do however not know the full consequenses


includes/joomla.php line 2742


Code: Select all

if (eregi( "[\<|\>|"|\'|\%|\;|\(|\)|\&|\+|\-]", $this->username) || strlen( $this->username ) < 3) {


to eg.

Code: Select all

if (eregi( "[\<|\>|"|\'|\%|\;|\(|\)|\&|\+|\-]", $this->username) || strlen( $this->username ) < 1) {

Re: username lengths

Posted: Mon Sep 17, 2007 6:02 pm
by redfeather
I applied the changes to a test installation, and everything seems to be working okay, so far.

Thanks for the help!

Re: username lengths

Posted: Mon Sep 17, 2007 10:08 pm
by sviftrup
Thats great!

I just changed the eregi so i can have usernames that uses -
hopefully none of us will see any problems!