Hello!
I have seen, MODx is case sensitive for login usernames and captcha. If my username is "Boby" and I type "boby" (lowercase b), same thing with captcha, I get an unvalid username error.
Can this be eventually turned off by default? Ok, I know it, but probably some new user won’t know it and after one or two failed logins they just leave.
If this is not going to be default, can you tell me please where I can change this to have it for my installation?
Thank you!
Boby
A quick way to solve this, you can modified the snippet for web login and registration. Basically if you use this snippet to handle your front web users, you can modify it to be case insensitive.
Hi,
You could also create a plugin to handle this case-insensitive user name.
I admit that perhaps we should make this part of the core code. Usernames really shouldn’t be subjected to being case-sensitive. If anything, the need for case-sensitive usernames should be the other way around. In otherwords, if you need your usernames to be case-sensitive then you would need to create a plugin to do so. Just a thought.
Jeff Whitfield
"I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
-
MODX Staff
- 10,725 Posts
I don’t think this is a decision that can be trivialized to a plugin. The issue is enforcement of data integrity in the database, and to properly handle both situations really requires data structure differences (e.g. a UNIQUE INDEX on username vs. lower(username)).
True, true...but there are ways of doing a query in MySQL that isn’t case-sensitive. It’s probably just a matter of making the lookup of a username case-insensitive. We certainly don’t want to have issues happen where a username is duplicated twice just because of the case-sensitivity of usernames.
Quote from: OpenGeek at Apr 28, 2006, 10:30 AM
I don’t think this is a decision that can be trivialized to a plugin. The issue is enforcement of data integrity in the database, and to properly handle both situations really requires data structure differences (e.g. a UNIQUE INDEX on username vs. lower(username)).
Jeff Whitfield
"I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
Hi. I too was surprised to find that usernames were case sensitive. The issue needs to be resolved ASAP before the headache of lots of similarly-named users sign up.
There is an additional reason that people may find case-sensitivity confusing - some MODx styles print the username of commenters in uppercase... so people may think "Well, it’s uppercase there why isn’t it recognising me when I type it in uppercase here?"
Having played with the system, I note that the email address is checked for uniqueness in a non-case-sensitive way (but stored as typed).
Djamoer’s solution would therefore work - doing a case-insensitive check at both registration and login would be fine (assuming there are no "duplicates" already). Has anyone made the amended snippets yet? (I did not find one when I searched). If not, I shall write them and post them. Boby, have you solved this on your site?
[I had a post following this about Human Unique here but it has been removed for clarity given the resolution of the issue. I will post it again at some point, suitably modified.]
Here’s the solution for Boby.
Making Registration In-Use User Name-Check Case Insensitive
Is already case insensitive! That turns out to be the default on MySQL.
Somehow we all thought this was allowing "Bob" and "bob". But it doesn’t. It will find the other and not let you register.
Making Login User Name Case Insensitive
The code is in an include rather than the snippet itself, so it seems at this stage best to present this as a "hack":
Line 197 of assets\snippets\weblogin\weblogin.processor.inc.php
Remove the word BINARY
That’s it. I’m sorry it’s not in the form of a plug-in or snippet. And apologies if this trivialises some data integrity issue. But our lesson for today is that the MySQL search is case insensitive by default and can be made sensitive by use of the word BINARY before the fieldname in a WHERE clause.
I suggest this amendment is included in the next release.
I too feel your pain on this issue. I’m not for case-sensitive logins at all but should some user requires such it will be made available as an option.