Preventing obscene usernames from appearing in the "Member List": Can it be done Preventing obscene usernames from appearing in the "Member List": Can it be done
 

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]

Main Menu

Preventing obscene usernames from appearing in the "Member List": Can it be done

Started by Charlieos, March 15, 2006, 02:31:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Charlieos

Hi Fellow Copperminers!
I have a problem. I need to prevent obscene usernames from appearing in my Coppermine 1.3.3 "members list." I've tried to prevent such names from appearing by entering them into Coppermine as "banned" users. However, even if a user is banned, their name appears in the Member Llist.

To be sure, I could just delete or ban users who try to register with obscene names; However, I don't want to do that at all. What I need, instead, is to somehow enter or "reserve" obscene names BEFORE any user can register that name and then not have those usernames appear in the Member List. So, is it possible to do this in Coppermine? Is there any way to prevent obscene usernames from appearing in the Member List?

Any constructive advice, comments or ideas are most welcomed!

Charlieos

xplicit

Your version is highly outdated but well I will help you.

There are several ways to do this, for instance by making a table with all forbidden words in a table, using the banned words from the language file or just directly hardcoded in the register.php file.

I will give an example of the last option, adjust it as you like with a query or any other compare string

find at 411
$user_name = trim(get_post_var('username'));

add after:

if ($user_name == 'badword1' || $user_name == 'badword2') {
$error .= '<li>Username contains banned words';
}


ass you can see the bad word rule can be very long and could be much smaller if you would use an array but I think my post can help you guide into the good direction of how to implement it
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.