Gossamer Forum
Home : Products : Others : Gossamer Community :

Problem with Capitalisation of Usernames

Quote Reply
Problem with Capitalisation of Usernames
Just noticed this. Got an e-mail from a User (username Kevin) who could not log in. So I checked, and it turns out there is a "kevin" (who signed up first) and a "Kevin"- him, who could not get it.

So, it seems to me, that the check to see if a name is already in use in User.pm should check, well, all lower case maybe (but still allow users to capitalize their usernames in any way they want, and save them that way.)

Here is the existing code:

sub cuser_un_istaken {

# -------------------------------------------------------------------

my $username = shift;

return $DB->table('comm_users')->count( { comm_username => $username }) ? 1 : 0;

}

I was thinking something like:

sub cuser_un_istaken {

# -------------------------------------------------------------------

my $username = shift;

$username = lc($username);

return $DB->table('comm_users')->count( { comm_username => $username }) ? 1 : 0;

}

But that does not address making comm_username also lower case.

Any suggestions?

dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Problem with Capitalisation of Usernames In reply to
For anyone who cares, I did come up with a solution. Ugly, but it works. Added a new field to comm_Users- called it lc_username. Then I copied over all existing usernames, but made them lower case... all new additions are written into this field lc. Then it is easy to compare using lc(username).

Not too pretty, but it works!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Problem with Capitalisation of Usernames In reply to
Hi carfac,

just found that:

http://forums.devshed.com/t15409/s.html

maybe it is of some use?

Regards

Niko
Quote Reply
Re: [el noe] Problem with Capitalisation of Usernames In reply to
el noe:

That does help a lot! Thanks!
dave

Big Cartoon DataBase
Big Comic Book DataBase