XF 1.5 Prevent all caps username

Bob_R

Active member
Is there any method to prevent people from choosing all caps usernames?

I can see BSmith but not BSMITH.
 
This will require the following:

1) Only the a-z A-Z and 0-9 are allowed.
2) Username cannot be all numbers.
3) Username cannot be all caps.

Code:
^[a-zA-Z0-9]*[a-zA-Z][a-zA-Z0-9]*[a-z][a-zA-Z0-9]*$

Add to the following field:

Admin Control Panel -> Options -> User Registration -> User Name Match Regular Expression:
 
Also be sure to edit the following phrase:

this_is_name_that_will_be_shown_with_your_messages

This is what I suggest:

This is the name that will be shown with your messages. All caps, all numbers, spaces and non-alphanumeric characters are not allowed.
 
This will require the following:

1) Only the a-z A-Z and 0-9 are allowed.
2) Username cannot be all numbers.
3) Username cannot be all caps.

Code:
^[a-zA-Z0-9]*[a-zA-Z][a-zA-Z0-9]*[a-z][a-zA-Z0-9]*$

Add to the following field:

Admin Control Panel -> Options -> User Registration -> User Name Match Regular Expression:


So with this BSmith would be valid?

What about BFPierce?
 
@AndyB On your suggestion to change the phrase, post (#3), it reads that no spaces are allowed in username.

I don't mind spaces, I don't mind John Smith as opposed to JohnSmith. I just don't want all caps, JOHNSMITH or JOHN SMITH.

Is your code from post#2 still adhere to this?
 
To err on the safe side, can't you just edit all caps user later, instead of risking potential errors on user registration? Can't image you'd have too many people trying to get all caps.
 
Back
Top Bottom