Gossamer Forum
Home : Products : DBMan : Customization :

Case Sensitive User Names

Quote Reply
Case Sensitive User Names
I searched the forum and could not find an answer, although I did find a solution for those using the Secure Password Lookup Mod- which I do not have.

I want the UserNames to be case sensitive- If someone signs up as "Tom", I do not want "TOM" or ToM" to be allowed as valid UserNames to any body else that signs up. "Tom1" or "tom2", etc should be allowed. Thanks.

Quote Reply
Re: Case Sensitive User Names In reply to
The codes that JPDeni posted in the following Thread (have nothing to do with the Secure Password Mod) will do what you want:

http://www.gossamer-threads.com/...ew=&sb=&vc=1

Simple matter of editing the auth.pl!

Regards,

Eliot Lee
Quote Reply
Re: Case Sensitive User Names In reply to
That was the thread I was refering to. I tried changing the code in auth.pl as suggested by JPDeni, but it doesn't do what I want. That code will allow the user "tom" to login using "TOM", "Tom", or "ToM"- and works fine. But, I can still create new users of all the above variations of the name "tom"- which is want I don't want. I believe the other code in the thread has to do with a dbman mod.

I might be way off here, but I thought I might need to modify the following code (found in the sub_signup) of db.cgi

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 = "Requested User Name is unavailable");
}

I am assuming that this is the code that compares the requested Username to those already in the password file.

Thanks
Tom

Quote Reply
Re: Case Sensitive User Names In reply to
Try:

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:/i and ($message = "Requested User Name is unavailable");
}

Installs:http://www.wiredon.net/gt/
MODS:http://wiredon.net/gt/download.shtml

Quote Reply
Re: Case Sensitive User Names In reply to
Thanks- that was the solution I was looking for and it appears to be working fine. I also changed the same code in the admin function to prevent the admin from doing the same thing.

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:/i and ($message = "Requested User Name is unavailable");
}

This was the first time I've posted a question to the forum- I can usually find what I need by seaching or by going to the Unofficial FAQ Site for DBMan. Many thanks for the speedy replies.

Tom