Block characters used in usernames Block characters used in usernames
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Block characters used in usernames

Started by roxystar13, January 28, 2006, 09:24:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

roxystar13

Is there a way to block certain words from being used in a username? For example, my forum has a baseball theme, but I don't want 50 users having "Jeter" or "NYY" in their usernames...I want more original ones. Is this even possible?


Thank you in advance.


Aloha.

Nibbler

Assuming you are running unbridged, it is fairly easy but your request is very subjective. If you can make a list of usernames that would be invalid or phrases that should not appear in usernames then that could be hacked in alongside the existing checks for things like the length of the username.

roxystar13

Quote from: Nibbler on January 28, 2006, 10:07:57 PM
Assuming you are running unbridged, it is fairly easy but your request is very subjective. If you can make a list of usernames that would be invalid or phrases that should not appear in usernames then that could be hacked in alongside the existing checks for things like the length of the username.

Thank you for your reply.
I am running unbridged, how would I go along by doing this?

Joachim Müller

edit register.php, find    if (utf_strlen($user_name) < 2) $error .= '<li>' . $lang_register_php['err_uname_short'];
    if (utf_strlen($password) < 2) $error .= '<li>' . $lang_register_php['err_password_short'];
    if ($password == $user_name) $error .= '<li>' . $lang_register_php['err_uname_pass_diff'];
    if ($password != $password_again) $error .= '<li>' . $lang_register_php['err_password_mismatch'];
and add after it (in a new line) this code    if (utf_substr($user_name,0,5) == 'Jeter') $error .= '<li>The username mustn\' contain the word &laquo;Jeter&raquo;';(code not tested).