Topic: AJAX Username Check - taken names AND banned names
Hi all
This is my first mod.
I thought the existing AJAX username check was very nice by telling someone if a username was already taken when they enter it.
However, I thought it would be even better if it also checked against your custom banned usernames as well.
So this is what I did (vldpersonals 2.5.3):
Edit, hp.checkusername.php in /includes/hp
add on line 80 (just after existing username check):
//------------------------------------------------
// Check if username is banned - MOD BY MS
//------------------------------------------------
$usernames = array_map('trim', explode("\n", $PREFS->conf['banned_usernames']));
if ( in_array($username, $usernames) )
{
die("error\n".$LANG['register']['username_taken']);
}
I have decided (for the moment) to show the same error message as if it was taken, but you may decide to make another message.
Enjoy!
Last edited by idealists (2009-08-26 21:11:41)