latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Capitals in username

Home Forums Community Forum Capitals in username

Tagged: ,

This topic contains 12 replies, has 3 voices. Last updated by  Craig Wallace 4 years, 2 months ago.

Topic Author Topic
Posted: Sunday Sep 23rd, 2012 at 3:26 pm #26210
Craig Wallace
Username: Craig

Hi,

I am new to s2member and fairly new to wordpress. I have set up my paypal sandbox and am testing my s2member registration form. The only problem I am getting is the message:

ERROR: This username is invalid because it uses illegal characters. Please enter a valid username.

This seems to be purely due to using a capital letter at the start of the user name. I don’t think many people would ever think ‘illegal character’ = ‘capital letter’, and the registration page presented by s2member gives no indication that the name has to be all lower case.

How can I either;
Allow upper case letters in the username.
Add text to the error message to say what ‘illegal characters’ are.
Force the username to be all lower case using javascript.

Thanks.

Craig

  • This topic was modified 4 years, 3 months ago by  Craig Wallace. Reason: reword title

List Of Topic Replies

Viewing 12 replies - 1 through 12 (of 12 total)
Author Replies
Author Replies
Posted: Sunday Sep 23rd, 2012 at 4:04 pm #26223
Eduan
Username: Eduan
Moderator

Hello Craig,

Could you please post the username that you were trying to register? Uppercase letters are not an illegal character.

Posted: Monday Sep 24th, 2012 at 5:46 am #26271
Craig Wallace
Username: Craig

I tried Craig and got the error.

As soon as I changed Craig to craig, it worked fine.

I am using WordPress 3.4.2 MU if it helps.

Craig

  • This reply was modified 4 years, 3 months ago by  Craig Wallace.
Posted: Monday Sep 24th, 2012 at 12:15 pm #26326
Eduan
Username: Eduan
Moderator

That’s very strange, could you please put a list of the plugins that you have installed? Also could you test changing your theme to the default WordPress theme (TwentyEleven)?

– Eduan

Posted: Tuesday Sep 25th, 2012 at 3:47 pm #26467
Craig Wallace
Username: Craig

Hi Eduan,

I am using TwentyEleven for my site. Well, it is a child theme of that for some CSS tweaks and a small change in the header to remove the search.

My active plugins:

Contact Form to DB Extension
Events Made Easy
Fast Secure Contact Form
Get Login
s2Member® Framework
Slickr Flickr
Social Media Widget
WP Show IDs
Wysija Newsletters

Installed but inactive:

Akismet
Hello Dolly
WP125

Thanks,

Craig

Posted: Tuesday Sep 25th, 2012 at 3:58 pm #26471
Eduan
Username: Eduan
Moderator

Hmm, I’m not experienced with any of these.

Could you try disabling all of them and see if the problem disappears? If it does, could you try enabling them again until the problem appears again?

If it doesn’t disappear disabling the plugins, could you change to the TwentyEleven theme, not using the child theme in other words.

– Eduan

Posted: Tuesday Sep 25th, 2012 at 5:28 pm #26476
Craig Wallace
Username: Craig

The only plugin mentioned on the registration page source HTML seems to be slickr-flickr, which also includes lightbox and galleria, but the error message is server-side code so I don’t see how that could cause the problem.

Is there definitely no s2member, or wordpress, ‘allow upper case in user name’ setting somewhere that I’m missing?

I’ll try disabling stuff and the theme change, but isn’t the username check a call into the wordpress API?

Thanks again.

Craig

Posted: Tuesday Sep 25th, 2012 at 6:07 pm #26484
cassel
Username: cassel

I am probably not going to be very helpful, but i have had many users register with capital letters, though s2M, however i know my brother tried to register and had a hyphen and it would not take it, but i think it was a WP thing, NOT a s2M thing. Interestingly, i am using a plugin that will create a username based on an email, and although you cannot register with non alpha-numerical characters, directly in the registration form, it will accept them if they come “from the back door” since i have now, members with a @ in their username (since it is an email).

Like i said, it is probably not helpful other than pointing a finger to something ELSE. Are you using a different font maybe and it would not recognise the C as a valid alpha-numerical character? Also, have you tried with other names and see if maybe (i really say “maybe”) it would only apply to some characters? Just wild guesses at this point.

Good luck

Posted: Tuesday Sep 25th, 2012 at 9:25 pm #26500
Eduan
Username: Eduan
Moderator

If I’m not mistaken, WordPress accepts all alphanumeric characters, s2Member does not change this, but of course this can be modified through plugins. So like I said, make sure that you test changing your theme and deactivating all the plugins, the problem is caused by one of them, or a hack you inserted that affects your register page.

Hope this helps. :)

Posted: Wednesday Sep 26th, 2012 at 2:58 pm #26611
Craig Wallace
Username: Craig

Hi Eduan,

I have now done some more research on this, and from what I have read, WordPress MU does NOT allow uppercase characters in usernames. This is because they are also used for the sub-domains, which WordPress (incorrectly) assumes have to be all lower case.

So, given that this is actually core WordPress functionality, how can I customise the s2member registration screen so that the restriction on username is described to the user? Also, how could I add a client-side onblur event to force the username to lower case when they exit the field?

Thanks,

Craig

Posted: Wednesday Sep 26th, 2012 at 4:41 pm #26617
Eduan
Username: Eduan
Moderator

Oh OK, yeah there may be something different between the normal WordPress version and the multisite version.

The only simple way I know of, to modify WordPress text in the registration page is using my hack:
http://eduantech.com/code-snippets/wordpress-text-replacing-hack

Other than that you would simply have to hack it in yourself, I think. :/

– Eduan

Posted: Friday Nov 2nd, 2012 at 7:21 am #30424
Craig Wallace
Username: Craig

I have had a bit of a look through the source and can’t find how the registration page is built. There doesn’t seem to be a template anywhere?

Ideally, I would just add onBlur=”this.value = this.value.ToLower();” or similar to the username field.

Can anyone point me to the file that I would need to edit?

Thanks.

Posted: Friday Nov 2nd, 2012 at 4:48 pm #30487
Craig Wallace
Username: Craig

I have edited line 129 of my wp-signup.php to be:

echo '<input name="user_name" type="text" id="user_name" value="'. esc_attr($user_name) .'" maxlength="60" onBlur="javascript:this.value=this.value.toLowerCase();" /><br />';

Hopefully that should cover it.

Viewing 12 replies - 1 through 12 (of 12 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.