Gossamer Forum
Home : Products : DBMan : Customization :

case sensitive usernames

Quote Reply
case sensitive usernames
How do you make it so that the usernames don't have be to case sensitive? I don't want it so that someone can make "bubba" and someone else can make "Bubba" I'm making people create their own accounts, have the password lookup mod which also has the change password mod.
Quote Reply
Re: case sensitive usernames In reply to
In sub change_password, look for the line

if ($pass =~ /^$db_userid:/) {

Try changing that to

if ($pass =~ /^$db_userid:/i) {

Later note: This one will stay the same.

In the replacement for sub signup look for

if ($in{'userid'} eq $userid) {

change that to

if (lc($in{'userid'}) eq lc($userid)) {

Later note: This one is different.

I'm not sure it will work, but it should.

Those are the only two places where people enter usernames, so that should be the only places you'll need to change it. Oh, sub admin_display. Hmmmm. Just a sec and I'll look for it.

Here it is. Change

if ($in{'new_username'} eq $userid) {

to

if (lc($in{'new_username'}) eq lc($userid)) {

Later note: This one is different.

This will allow someone to add a name like "Bubba2" or "SubBubba." But will not allow bubba or BuBbA


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



[This message has been edited by JPDeni (edited August 16, 1999).]
Quote Reply
Re: case sensitive usernames In reply to
I just want to get rid of case sensitivity. I want people to be able to make Bubba1, Bubba2, etc. However, I want Bubba1 to work the same as BuBBa1 when they log in. I put in the code you gave me and it worked fine in not letting others have BUbbA when I have Bubba.

Also, what about the logins that ask for the username when you need to relogin after chanign your password or email?

Thanks Smile
Quote Reply
Re: case sensitive usernames In reply to
Take out the code I gave you, because it won't give you want you want.

I'll change the code in my previous message, so this thread doesn't get too long.

Quote:
Also, what about the logins that ask for the username when you need to relogin after chanign your password or email?
What about them?

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





Quote Reply
Re: case sensitive usernames In reply to
You enter usernames at them, too, so should their code be changed, too?
Quote Reply
Re: case sensitive usernames In reply to
No. The only time that the username needs to be checked is when the username is being changed.


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





Quote Reply
Re: case sensitive usernames In reply to
Thanks for the help so far, but I'm still having a problem. Let's say I create an account as Bubba. When I log in, I want to be able to log in as bubba, BubBa, etc...but it says invalid username. It won't let anyone create another bubba or BuBBa, but I want to be able to log in as it.
Quote Reply
Re: case sensitive usernames In reply to
Well, that's a completely different question that what you asked before.

Look in auth.pl for

Code:
if (($in{'userid'} eq $userid) && (crypt($in{'pw'}, $pw) eq $pw)) {

change it to

Code:
if ((lc($in{'userid'}) eq lc($userid)) && (crypt($in{'pw'}, $pw) eq $pw)) {

Further down in that same script find

Code:
if ($username eq $name) {

change that to

Code:
if (lc($username) eq lc($name)) {

That oughta do it, but I haven't tested it.

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





Quote Reply
Re: case sensitive usernames In reply to
Thanks..my first message was kind of hard to understand. Anyways, thanks for the help, it works great! Smile I really appreciate it!
Quote Reply
Re: [JPDeni] case sensitive usernames In reply to
Hi JPDeni,

I was looking for info on case sensitive usernames and found it but it was too much and all over the place with modified posts etc that made it difficult for me to understand as I did not see the conversation take place. Will it be possible for you to post it again in entirety or may be as a modification or some thing? My problem being that I want the John, jOHn, joHN all to be the same. To this end I think if the username and password are stored in lower case it should resolve the issue. Correct me if I am wrong.

I would not know a script if it bit me ...... I know you are busy and have to look after more serious issues but if you be a little more detailed Smile

Thanks in advance

FHN
Quote Reply
Re: [fhnaqvi] case sensitive usernames In reply to
I can not exactly help you....

JPDeni hasnt been around for while now...

from her profile:

Last Logon: Oct 12, 2001, 3:06 PM
--------------
some good resources you should check out :
LoisC DBMan Unofficial FAQ:
http://webmagic.hypermart.net/dbman/

of course JPDeni's site:

http://www.jpdeni.com/dbman/

good luck,

Warp.

Quote Reply
Re: [Warp] case sensitive usernames In reply to
Can you tell me where I can find all the code/instructions in one place or maybe you submit this as a MOD. That would consolidate all the instructions in one place.

FHN
Quote Reply
Re: [fhnaqvi] case sensitive usernames In reply to
In Reply To:
Can you tell me where I can find all the code/instructions in one place or maybe you submit this as a MOD. That would consolidate all the instructions in one place.

FHN

Sorry, im not well versed with cgi/scripting.....

good luck,

Warp.

Quote Reply
Re: [Warp] case sensitive usernames In reply to
Did you try modifying your auth.pl file as instructed in Post #8? That seems to state exactly what changes need to be made. If so, did it work as expected?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] case sensitive usernames In reply to
Hi LoisC,

Thanks for your help. I tried the instructions as described in the post above. I had already created a user 'test' so I tried logging in as 'Test' with the same password but it did not work, then I tried creating another user 'Test' and it worked. Meaning I now have 2 users 'test' and 'Test'. While I just want it all to be non case sensitive whether creating users or logging in.

Thanks in advance

FHN
Quote Reply
Re: [LoisC] case sensitive usernames In reply to
Hi all,

I tried the suggestion in post #8 in this thread above but it did not work. I am still looking for a way to make the userids non case sensitive. any suggestions ?

FHN
Quote Reply
Re: [LoisC] case sensitive usernames In reply to
Hi LoisC,

Let me correct myself first. The fix that you directed me to, actually worked. What I wanted to say was that I wanted to make the password also case insensitive. Meaning that both the username and the password become non case sensitive.

Thanks for the guidance and sorry for the misleading post earlier.

FHN