Gossamer Forum
Home : Products : DBMan : Customization :

Duplicate usernames

Quote Reply
Duplicate usernames
Why does DBMan allow two users to have the same username and password? I would like to prevent anyone from having the same username, as I am using it to maintain state on a shopping cart.

Any ideas?
Quote Reply
Re: Duplicate usernames In reply to
I believe this code in sub signup in your db.cgi should prevent duplicate usernames.

open (PASS, "<$auth_pw_file") or &cgierr ("unable to open: $auth_pw_file.\nReason: $!");
if ($db_use_flock) { flock(PASS, 1); }
while (<PASS> ) {
/^\Q$in{'userid'}\E:/ and ($message = "userid already exists. Please try another.");
}
close PASS;

It should already be in there. I assume you are using $auth_signup = 1 in the default.cfg


[This message has been edited by mike1 (edited June 25, 1999).]
Quote Reply
Re: Duplicate usernames In reply to
Have you seen an instance where DBMan allowed duplicate usernames? There are a number of places in the script that prevent that from happening.


------------------
JPD