Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Block characters used in usernames  (Read 3409 times)

0 Members and 1 Guest are viewing this topic.

roxystar13

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 9
Block characters used in usernames
« 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.
Logged

Nibbler

  • Guest
Re: Block characters used in usernames
« Reply #1 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.
Logged

roxystar13

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 9
Re: Block characters used in usernames
« Reply #2 on: January 29, 2006, 12:06:28 am »

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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Block characters used in usernames
« Reply #3 on: January 29, 2006, 01:31:51 pm »

edit register.php, find
Code: [Select]
    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
Code: [Select]
    if (utf_substr($user_name,0,5) == 'Jeter') $error .= '<li>The username mustn\' contain the word &laquo;Jeter&raquo;';(code not tested).
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.