username lengths

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
redfeather
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Sep 15, 2007 2:24 pm
Location: California

username lengths

Post by redfeather » Mon Sep 17, 2007 8:53 am

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!

User avatar
sviftrup
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Sep 02, 2005 11:40 am
Location: Denmark
Contact:

Re: username lengths

Post by sviftrup » Mon Sep 17, 2007 2:41 pm

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) {
SV Consult
- Webprogrammør

User avatar
redfeather
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Sep 15, 2007 2:24 pm
Location: California

Re: username lengths

Post by redfeather » Mon Sep 17, 2007 6:02 pm

I applied the changes to a test installation, and everything seems to be working okay, so far.

Thanks for the help!

User avatar
sviftrup
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Sep 02, 2005 11:40 am
Location: Denmark
Contact:

Re: username lengths

Post by sviftrup » Mon Sep 17, 2007 10:08 pm

Thats great!

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


Post Reply