Announcement

Collapse
No announcement yet.

Special characters when registering

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Special characters when registering

    Is there a way to keep users from registering account usernames with special characters or spaces?

    I am running Vb 3.8.2 and using a Joomla 1.5 bridge. This bridge imports the VB users into Joomla. But when a VB username contains special characters the bridge creates the Joomla accounts with underscores instead of the special characters (since Joomla usernames can not contain special characters). So then some usernames do not match and this causes login and other problems for those particular accounts.

    I figured the simpliest way to fix this is to keep VB from allowing special characters in usernames when a new account is registered.

    Can someone shed some light on how to make this happen. Thanks!

  • #2
    Try this:

    vBulletin Options > vBulletin Options > User Registration Options > Username Regular Expression: ^[A-Z0-9 ]+$
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Thanks I tried that but when trying to register an account I keep getting the message:

      That username is already in use or does not meet the administrator's standards. If you are techpuzz and you have forgotten your password, click here.

      I've tried to register several different usernames with a mixture of lowercase letters and numbers.

      Comment


      • #4
        Hmmm...that worked when I tested it. You can find examples of many different regular expressions on this site:

        http://regexlib.com/
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment


        • #5
          Originally posted by technopuzzle View Post
          Thanks I tried that but when trying to register an account I keep getting the message:

          That username is already in use or does not meet the administrator's standards. If you are techpuzz and you have forgotten your password, click here.

          I've tried to register several different usernames with a mixture of lowercase letters and numbers.
          The regular expression Steve suggested would not allow any lower case. Try this:

          ^[A-Za-z0-9 ]+$

          Comment


          • #6
            That worked perfectly! I did remove the "space" since I want to be 100% sure it won't cause conflicts with the Joomla user tables.

            Do you know what the ^ + $ are for or what they do?

            Comment


            • #7
              + matches previous item 1 or more times
              ^ positional indicator
              $ positional indicator

              By placing the ^ and $ around our expression it will make sure that there are no spurious characters preceding or following the user name.

              Comment


              • #8
                Originally posted by Andy View Post
                The regular expression Steve suggested would not allow any lower case. Try this:

                ^[A-Za-z0-9 ]+$
                Thanks for the correction Andy.
                Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                Change CKEditor Colors to Match Style (for 4.1.4 and above)

                Steve Machol Photography


                Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                Comment


                • #9
                  Could some one please tell me how to allow also - and _

                  Thanks so much!

                  Comment


                  • #10
                    Originally posted by cvn View Post
                    Could some one please tell me how to allow also - and _

                    Thanks so much!
                    Try this:

                    ^[a-zA-Z0-9_\-]+$

                    Comment


                    • #11
                      Originally posted by Andy View Post
                      Try this:

                      ^[a-zA-Z0-9_\-]+$
                      Thank you so much for your help!

                      It works perfectly.

                      Comment

                      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                      Working...
                      X