Hi, I had to accomplish this recently and wanted to share with the community.
I was asked to prevent duplicate usernames from being added to the database. It isn't too difficult.
I added the following to the Events -> admin_users -> Add page -> Before record added
$count = DBLookup("select count(id) from users where username=\"".$values['username']."\"");
if($count==1){
$message="Username '".$values['username']."' already exists. Please choose another.";
$values['password']="";
}
return $count==0;
This takes care of it!
Thanks for all the help.