We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3763
    • 155 Posts
    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
      ...my Photo Gallery on Flickr...
      • 32241
      • 1,495 Posts
      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.
        Wendy Novianto
        [font=Verdana]PT DJAMOER Technology Media
        [font=Verdana]Xituz Media
        • 32963
        • 1,732 Posts
        Hi,

        You could also create a plugin to handle this case-insensitive user name.
          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 4018
          • 1,131 Posts
          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. wink
            Jeff Whitfield

            "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
            • 22303 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)).
              • 4018
              • 1,131 Posts
              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. wink

              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."
                • 22815
                • 1,097 Posts
                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.]
                  No, I don't know what OpenGeek's saying half the time either.
                  MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                  Forum: Where to post threads about add-ons | Forum Rules
                  Like MODx? donate (and/or share your resources)
                  Like me? See my Amazon wishlist
                  MODx "Most Promising CMS" - so appropriate!
                  • 22815
                  • 1,097 Posts
                  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.
                    No, I don't know what OpenGeek's saying half the time either.
                    MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                    Forum: Where to post threads about add-ons | Forum Rules
                    Like MODx? donate (and/or share your resources)
                    Like me? See my Amazon wishlist
                    MODx "Most Promising CMS" - so appropriate!
                    • 3763
                    • 155 Posts
                    Thank you Paul smiley
                    I will try this now, and come back if something is not working tongue

                    Boby
                      ...my Photo Gallery on Flickr...
                      • 32963
                      • 1,732 Posts
                      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.

                        xWisdom
                        www.xwisdomhtml.com
                        The fear of the Lord is the beginning of wisdom:
                        MODx Co-Founder - Create and do more with less.