MyBB Central

Full Version: Lower Case usernames force!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to force all registrations to happen in lowercase only, so if someone punches in ABCDEF as the username, it will get registered as abcdef. Which file do I edit and add the code? Any ideas?

Thanks in advance!
Edit the member.php file.


PHP Code:
        "username" => $mybb->input['username'], 

Replace with:

PHP Code:
        "username" => strtolower($mybb->input['username']), 

I haven't tested this though, so I'm not sure that it will work perfeclty Smile
I will test and let you know. Thanks!
I hope it works ok Smile
Oh I tried to do something similar:
PHP Code:
"username" => $mybb->strtolower(input['username']), 

But it didn't work for me. I dont know if code's euantor works, but looks well.
Yeah, that wouldn't work seeing as you're putting the strtolower in the middle of an array xD. It needs to be outside of the whole variable then it should work. I'm going to test it now.

EDIT: it works. No problem at all. Upon registration, the username is just converted to lowercase. I tried it with all caps, mixed lower and upper caps and no caps.
Yup it works. Euantor, are you interested to customize a theme for this forum - with a matching erheader preferably? If you feel interested drop me a PM.