Advertisement
Illegal Username Characters
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
- jgilhousen
- Joomla! Apprentice
- Posts: 32
- Joined: Wed Dec 07, 2005 11:52 pm
- Location: Oregon
- Contact:
Illegal Username Characters
Anyone know of an easy way to permit usernames with characters that are illegal by default for Joomla! usernames, specifically the hyphen?
Advertisement
- benedikt
- Joomla! Explorer
- Posts: 346
- Joined: Mon Aug 22, 2005 2:29 pm
- Location: Gent - Belgium
Re: Illegal Username Characters
I don't know enough php to answer that, so I can't provide an easy answer
Maybe not much of a help, but I 'd start with taking a look at mod_login.
But there is probably a very good reason why such characters are illegal, most likely to avoid malicious code injection.
Furthermore, many people consider it good practice NOT to hack/modifie the core code. It can make upgrading a real pain.
So, my humble advice would be to encourage your users to use names that don't have these illegal characters.
Maybe not much of a help, but I 'd start with taking a look at mod_login.
But there is probably a very good reason why such characters are illegal, most likely to avoid malicious code injection.
Furthermore, many people consider it good practice NOT to hack/modifie the core code. It can make upgrading a real pain.
So, my humble advice would be to encourage your users to use names that don't have these illegal characters.
- jgilhousen
- Joomla! Apprentice
- Posts: 32
- Joined: Wed Dec 07, 2005 11:52 pm
- Location: Oregon
- Contact:
Re: Illegal Username Characters
I understand that such a feature was probably instituted for a valid reason, but I believe I have equally valid reasons to make an exception. I don't much relish the notion of mucking about the code, and keeping change logs to assist in upgrades, but there are times when it is necessary, and this is probably just such a time. I won't bore you with the reasons.
If I do end up taking a monkey wrench to Joomla! nuts and bolts, some guidance narrowing it down would be of great value. I'll see what I can find in mod_login.
Thanks & Merry Christmas.
If I do end up taking a monkey wrench to Joomla! nuts and bolts, some guidance narrowing it down would be of great value. I'll see what I can find in mod_login.
Thanks & Merry Christmas.
-
- Joomla! Apprentice
- Posts: 9
- Joined: Fri Sep 16, 2005 6:08 pm
Re: Illegal Username Characters
I had the same issue as I imported 5000 forum users into Joomla, and a lot of them had usernames with special characters. So I needed to find a way to allow these characters. With some help from other Joomla members, I think I got it right.
Now, I have Community builder installed as well, and even though I thought I had the problem taken care of, some of my users are still complaining they are not able to update their profiles.
Anyway, here's the hack...
Look in /includes/joomla.php and find this block of code
are the characters that are not allowed in usernames. What you want to do is to remove the characters that you want to allow. So if you want to allow the hyphen, this is the code to use:
I'd really appreciate some input from the devs on this. I'm not sure I have done this the right way... A backend option on which characters not to allow in a username would be awesome.
Now, I have Community builder installed as well, and even though I thought I had the problem taken care of, some of my users are still complaining they are not able to update their profiles.
Anyway, here's the hack...
Look in /includes/joomla.php and find this block of code
Code: Select all
if (eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", $this->username) || strlen( $this->username ) < 3) {
$this->_error = sprintf( _VALID_AZ09, _PROMPT_UNAME, 2 );
return false;
}
Code: Select all
[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]
Code: Select all
if (eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+]", $this->username) || strlen( $this->username ) < 3) {
$this->_error = sprintf( _VALID_AZ09, _PROMPT_UNAME, 2 );
return false;
}
- louis.landry
- Joomla! Ace
- Posts: 1380
- Joined: Wed Aug 17, 2005 11:03 pm
- Location: San Jose, California
- Contact:
Re: Illegal Username Characters
What you did is correct... and a list of banned characters is not a bad idea.... I will keep you posted.
Louis
Louis
Joomla Platform Maintainer
A hacker does for love what others would not do for money.
A hacker does for love what others would not do for money.
- jgilhousen
- Joomla! Apprentice
- Posts: 32
- Joined: Wed Dec 07, 2005 11:52 pm
- Location: Oregon
- Contact:
Re: Illegal Username Characters
Thanks for pointing me in the right direction. I kept overlooking it on my own.
I understood the need for a banned characters list, but wish it were more easily configurable, for those instances when an exception should be made. Life is full of exceptions.
I understood the need for a banned characters list, but wish it were more easily configurable, for those instances when an exception should be made. Life is full of exceptions.
- jgilhousen
- Joomla! Apprentice
- Posts: 32
- Joined: Wed Dec 07, 2005 11:52 pm
- Location: Oregon
- Contact:
Re: Illegal Username Characters
Argh! I posted too soon -- before actually doing the edit.
After removing the hyphen and separating backslash preceding it, I logged into the front end, went to Your Details, and tried to insert a hyphen into my username. Result: Error message for invalid username.
So, I logged out, and logged into back end as admin, and tried to do the same change in User Management. No go there, either.
Do I need to do a textsearch of every file to find all instances of that array?
John-Mark +
After removing the hyphen and separating backslash preceding it, I logged into the front end, went to Your Details, and tried to insert a hyphen into my username. Result: Error message for invalid username.
So, I logged out, and logged into back end as admin, and tried to do the same change in User Management. No go there, either.
Do I need to do a textsearch of every file to find all instances of that array?
John-Mark +
-
- Joomla! Apprentice
- Posts: 26
- Joined: Thu Mar 09, 2006 4:42 pm
- Contact:
Re: Illegal Username Characters
John-Mark,
Did you ever figure out how to make this work? I am in the same boat -- need to import an existing list and my board is QUITE insistent that the usernames be our members' email addresses. ANDDDD many of them have hyphens.
Any assistance from anyone will be greatly appreciated. (And yes, I understand why there are the restrictions on special characters, but this is essential.)
Thank you,
Anne
Did you ever figure out how to make this work? I am in the same boat -- need to import an existing list and my board is QUITE insistent that the usernames be our members' email addresses. ANDDDD many of them have hyphens.
Any assistance from anyone will be greatly appreciated. (And yes, I understand why there are the restrictions on special characters, but this is essential.)
Thank you,
Anne
Author, EZ Fun Guide to Walt Disney World
My first Joomla site: http://www.ez-wdw.com
My first Joomla site: http://www.ez-wdw.com
- jgilhousen
- Joomla! Apprentice
- Posts: 32
- Joined: Wed Dec 07, 2005 11:52 pm
- Location: Oregon
- Contact:
Re: Illegal Username Characters
Anne,
Nope. I spent several days trying, and never could get it to fly. I decided I need to get further along in php tutorials before taking another stab at it.
The limitation is a real problem for us, because ours is a family history and genealogy site, so we strongly encourage people to use their real names, often (like mine) including a hyphen.
I would really appreciate it if one of the php gurus in the Joomla! community could crack it for us.
J-M
Nope. I spent several days trying, and never could get it to fly. I decided I need to get further along in php tutorials before taking another stab at it.
The limitation is a real problem for us, because ours is a family history and genealogy site, so we strongly encourage people to use their real names, often (like mine) including a hyphen.
I would really appreciate it if one of the php gurus in the Joomla! community could crack it for us.
J-M
-
- Joomla! Apprentice
- Posts: 26
- Joined: Thu Mar 09, 2006 4:42 pm
- Contact:
Re: Illegal Username Characters
J-M!!!!!
I did it!!! I have Community Building installed. I had edited several files using your edit -- basically taking out the "|\-". Then I looked at the source code and saw that it was picking up a script somewhere, so I searched some more and found this: http://forum.mamboserver.com/archive/in ... 52287.html. So I looked for a file that would do what the Mambo user_extended component does.
The key was finding components/com_comptroller/comprofile.html.php. Look for this line in a similar file:
and edit the |\- out.
It now works. FWIW, I could input the email address as the user name directly into the database table. But if you opened that record within Joomla, you couldn't edit anything about that record -- such as changing password -- without triggering the error message.
I still have some tweaking to do to get our members-only site working. But I am very hopeful -- It's only Wednesday and I have a goal of Friday. I might be able to make it.
Thanks for your inspiration. Let me know if it works for you.
Anne
I did it!!! I have Community Building installed. I had edited several files using your edit -- basically taking out the "|\-". Then I looked at the source code and saw that it was picking up a script somewhere, so I searched some more and found this: http://forum.mamboserver.com/archive/in ... 52287.html. So I looked for a file that would do what the Mambo user_extended component does.
The key was finding components/com_comptroller/comprofile.html.php. Look for this line in a similar file:
Code: Select all
var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");
It now works. FWIW, I could input the email address as the user name directly into the database table. But if you opened that record within Joomla, you couldn't edit anything about that record -- such as changing password -- without triggering the error message.
I still have some tweaking to do to get our members-only site working. But I am very hopeful -- It's only Wednesday and I have a goal of Friday. I might be able to make it.
Thanks for your inspiration. Let me know if it works for you.
Anne
Author, EZ Fun Guide to Walt Disney World
My first Joomla site: http://www.ez-wdw.com
My first Joomla site: http://www.ez-wdw.com
- jgilhousen
- Joomla! Apprentice
- Posts: 32
- Joined: Wed Dec 07, 2005 11:52 pm
- Location: Oregon
- Contact:
Re: Illegal Username Characters
Sorry for the lag... somehow I missed your post in this topic.
Anyway, the site on which I have the need for hyphenated usernames does not have Community Builder installed, and I am reluctant to install it because of the likelihood of potential conflicts with other installed components (simpleboard and gedview).
So, there is no com_comptroller directory.
I may do a test installation with the mix of components to see if I am substituting one set of headaches for another... could be awhile, though.
J-M +
Anyway, the site on which I have the need for hyphenated usernames does not have Community Builder installed, and I am reluctant to install it because of the likelihood of potential conflicts with other installed components (simpleboard and gedview).
So, there is no com_comptroller directory.
I may do a test installation with the mix of components to see if I am substituting one set of headaches for another... could be awhile, though.
J-M +
-
- Joomla! Fledgling
- Posts: 1
- Joined: Thu Jun 29, 2006 3:37 pm
Re: Illegal Username Characters
Not sure if this will be germain any more, but I've just managed to get our new Joomla installation to accept hyphens in user names.
In the end I had to edit:-
YMMV
Murray Crane
Network Administrator
GGP Systems Ltd
In the end I had to edit:-
- includes/joomla.php
- components/com_user/user.html.php
- administrator/components/com_user/admin.users.html.php
YMMV
Murray Crane
Network Administrator
GGP Systems Ltd
- jgilhousen
- Joomla! Apprentice
- Posts: 32
- Joined: Wed Dec 07, 2005 11:52 pm
- Location: Oregon
- Contact:
Re: Illegal Username Characters
Thanks, Murray. I'll check that script and see if I can edit it to work for us. My users that were pushing for this feature seem to have given up, or at least have quit nagging me, but I know it is still an annoyance for many, so I do want to accommodate them when I can.
Regards,
J-M +
Regards,
J-M +
-
- Joomla! Fledgling
- Posts: 1
- Joined: Sat Aug 04, 2007 3:14 pm
Re: Illegal Username Characters
ack... iv searched the entire site for any/all occurances of |\" and fixed everything that even looked relevent (5 total), but it still wont let me put a - in a username!?
-
- Joomla! Apprentice
- Posts: 39
- Joined: Fri Aug 25, 2006 10:56 pm
Re: Illegal Username Characters
I am running 1.5 RC2. I am also hoping that their is a hack available to allow special characters
in usernames. I have been told that Joomla won't allow it but it seems that you could define a string
of acceptable or unacceptable characters that would allow a few.
My problem is I converted a phpbb2 forum to fireboard and most all users have unique characters
in their name (gaming clan site). If I can't get this to work, I'll have to stay with my present CMS.
in usernames. I have been told that Joomla won't allow it but it seems that you could define a string
of acceptable or unacceptable characters that would allow a few.
My problem is I converted a phpbb2 forum to fireboard and most all users have unique characters
in their name (gaming clan site). If I can't get this to work, I'll have to stay with my present CMS.
- C0nw0nk
- Joomla! Enthusiast
- Posts: 248
- Joined: Tue Jun 15, 2010 1:12 am
- Location: United Kingdom, London
- Contact:
Re: Illegal Username Characters
Thanks this is just what i was afterrocky222 wrote:I had the same issue as I imported 5000 forum users into Joomla, and a lot of them had usernames with special characters. So I needed to find a way to allow these characters. With some help from other Joomla members, I think I got it right.
Now, I have Community builder installed as well, and even though I thought I had the problem taken care of, some of my users are still complaining they are not able to update their profiles.
Anyway, here's the hack...
Look in /includes/joomla.php and find this block of codeCode: Select all
if (eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", $this->username) || strlen( $this->username ) < 3) { $this->_error = sprintf( _VALID_AZ09, _PROMPT_UNAME, 2 ); return false; }
are the characters that are not allowed in usernames. What you want to do is to remove the characters that you want to allow. So if you want to allow the hyphen, this is the code to use:Code: Select all
[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]
I'd really appreciate some input from the devs on this. I'm not sure I have done this the right way... A backend option on which characters not to allow in a username would be awesome.Code: Select all
if (eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+]", $this->username) || strlen( $this->username ) < 3) { $this->_error = sprintf( _VALID_AZ09, _PROMPT_UNAME, 2 ); return false; }
-
- I've been banned!
- Posts: 36
- Joined: Fri Feb 04, 2011 12:19 pm
Re: Illegal Username Characters
waoooooo C0nw0nk
after 4 years you finde it
after 4 years you finde it
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Jun 22, 2009 5:05 pm
Re: Illegal Username Characters
Hello,
I can't find these files in Joomla 3, also can't find solution for this, any suggestions ?
I can't find these files in Joomla 3, also can't find solution for this, any suggestions ?
Advertisement