Have you ever wanted to control what is used as a username when a new user creates an account? For example, if you wish to not allow 'Superman vs Batman' as a user name then just do the following:
Open inc.Function.php in the admin folder of your app.
Then look for function is_allowed_username($username){ - should be around line 662
Directly below $username = trim(strtolower($username));
Create a new line with the following:
Code: Select all
if(preg_match('/superman vs batman/i', $username)) return false;
You can put in whatever you wish to prevent being used. In this case, once someone types in whatever you wish to prevent it will come up with a warning and not allow the username. If you wish to prevent, for example, an email address being used as a username put in the following:
Code: Select all
if(preg_match('/@/i', $username)) return false;
What I have also done is create a list of unacceptable usernames and put them in a text file. I then have a line of code which checks to see if any of the usernames typed in are in that list and if so not allow them to be used.
Enjoy
Alan