Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Enforcing Lower case username restriction

Quote Reply
Enforcing Lower case username restriction
Hi,

Currently the username is taken in whatever case it is entered but login is functional in either case.

This can cause problems. I would want there there is built in restriction that the username is saved in database in lowercase. For example is a user signups with following:

username: UserName

the table should have

username: username and not UserName

How to enforce this in GM?

Thnx

Anup

Last edited by:

anup123: Aug 27, 2002, 1:48 AM
Quote Reply
Re: [anup123] Enforcing Lower case username restriction In reply to
Is there not a table editor like in links sql where you can enter a regex?
Quote Reply
Re: [Paul] Enforcing Lower case username restriction In reply to
Hi Paul,

I was traversing in the wrong direction perhaps which lead to so many posts of mine being in wrong place Wink. thnk God this was in the right forum.

Could u please enlighten me more on this. Why i need this to be there is:

Each Webmail Owner gets a 5 MB subdomain hosting account setup by default and integrated with GM database with www.user.domain.xxx being the address. Its thru Dynamic Virtual Hosting bypassing the /etc/passwd route for auth.

Now www.UsEr.domain.xxx would still be recognised as www.user.domain.xxx and certain utilities (like FileMan for managing the webspace for example) would give error when auth of fileman is thru webmail database ....

So the username has to be restricted to lowercase. Any help?

Thnx

Anup
Quote Reply
Re: [anup123] Enforcing Lower case username restriction In reply to
Hello!

I just saw a javascript on javascript.com or scriptsearch.com. There are javascripts available that enforces all the alphabets into smaill or capital letters. Very easy actually.

Check it out!
Quote Reply
Re: [anup123] Enforcing Lower case username restriction In reply to
If you edit admin/GMail/NoAuth/Join.pm, and go to around line 103, you should see:
Code:
$cgi->{email} = delete($cgi->{username}) . '@' . delete($cgi->{domain});
If you change this to:
Code:
$cgi->{email} = lc(delete($cgi->{username})) . '@' . delete($cgi->{domain});
That should insert them with their username in lowercase.

Adrian
Quote Reply
Re: [brewt] Enforcing Lower case username restriction In reply to
Hi Adrian,

I did the changes but still it does not work. I tried regsitering with AnuP123 and the username in dgraph table as it appears is AnuP123 instead of anup123

Any suggestions.

Thnx

Anup


=_= =_= =_= =_= =_= =_=


You can chain me, you can torture me, you can even destroy this body, but you will never imprison my mind.
-Mahatma Gandhi
Quote Reply
Re: [anup123] Enforcing Lower case username restriction In reply to
Gossamer Mail doesn't insert the username into the dgraph table. Is this a custom column that you added? In that same part of the code, you should be able to do a $var = lc $var to lowercase the variable in question.

Adrian
Quote Reply
Re: [brewt] Enforcing Lower case username restriction In reply to
Hi Adrian,

OK. as in the List Users display, the Display name is "Username" but dgraph_email in dgraph table. In any case despite doing the suggested changes in Join.pm what i get is


AnuP123@domain.xxx as email address

instead of

anup123@domain.xxx as desired.
So what do i do next..?

Thnx

Anup

Last edited by:

anup123: Sep 6, 2002, 5:21 AM
Quote Reply
Re: [anup123] Enforcing Lower case username restriction In reply to
Sorry, but I'm a little confused on which table and column you're referring to. On which table and column are you trying to make lowercase?

Adrian
Quote Reply
Re: [brewt] Enforcing Lower case username restriction In reply to
Hi Adrian,

Since I have no new columns introduced in GM wrt the username/email etc, what i wanted was that all the choice of username entered by the user during signup is converted to lowercase.

This does not happen despite making the changes in Join.pm

if i signup as

AnuP123 as username, it should be converted to anup123. Currently this does not happen when i see the database from the Admin. The account activation is "Not Validated" by default and admin activates the account.

Any suggestions

Thnx

Anup
Quote Reply
Re: [anup123] Enforcing Lower case username restriction In reply to
In Reply To:
The account activation is "Not Validated" by default and admin activates the account.


Hi!

When you finish the first part of the problem, there is a good chance that you may have to enter problems into the second part.

The quoted above does not work, at least in my case. May be it does with GT staff and no one has ever come to report. Such reports by myself have been and many times "first-one reports", cursed by other users as custom ones! So may be you may not have it! BTW, just for your information!
Quote Reply
Re: [brewt] Enforcing Lower case username restriction In reply to
Hi Adrian,

If i have not been able to clear out the matter of confusion please do let me know. The lower case still not happens despite having modified the Join.pm file......

Anup


=_= =_= =_= =_= =_= =_=


You can chain me, you can torture me, you can even destroy this body, but you will never imprison my mind.
-Mahatma Gandhi
Quote Reply
Re: [anup123] Enforcing Lower case username restriction In reply to
If you tell me exactly which column of which table you wish to have lowercased, then I can take a look for you. By default, the only place where the username is stored (user@domain) is the 'users' table ('email' column). The change that I posted above should make sure that it's inserted into that table with a lowercase username.

Adrian
Quote Reply
Re: [brewt] Enforcing Lower case username restriction In reply to
Hi Adrian,

The Admin interface is used to view the data. This has worked when i restarted the http after doing the changes in Join.pm I don't know if that has got anything to do with it, but it has worked...

Thnx

Anup


=_= =_= =_= =_= =_= =_=


You can chain me, you can torture me, you can even destroy this body, but you will never imprison my mind.
-Mahatma Gandhi