coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: roxystar13 on January 28, 2006, 09:24:10 PM

Title: Block characters used in usernames
Post by: roxystar13 on January 28, 2006, 09:24:10 PM
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.
Title: Re: Block characters used in usernames
Post by: 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.
Title: Re: Block characters used in usernames
Post by: roxystar13 on January 29, 2006, 12:06:28 AM
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?
Title: Re: Block characters used in usernames
Post by: Joachim Müller on January 29, 2006, 01:31:51 PM
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).