You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Raphaël Piéroni <ra...@gmail.com> on 2007/05/21 16:53:21 UTC

Using email as username

Hi,

I would like to have the username equals the email for any user.
I digged into the roller sources, but i can't find a way
to customise the current behaviour. I think this is automatically 
handled by acegy,
but i don't know anything in spring/acegy yet.

Can any one please send me some clue.

Thanks in advance for any help.

Raphaël
 


================================================================================

Les données et renseignements contenus dans ce message sont personnels, confidentiels et secrets. 
Ce message est adressé à l'individu ou l'entité dont les coordonnées figurent ci-dessus. 
Si vous n'êtes pas le bon destinataire, nous vous demandons de ne pas lire, copier, utiliser ou divulguer ce message. 
Nous vous prions de notifier cette erreur à l'expéditeur et d'effacer immédiatement ce message de votre système.

The information contained in this message is privileged, confidential, and protected from disclosure. 
This message is intended for the individual or entity addressed herein.
If you are not the intended recipient, please do not read, copy, use or disclose this communication to others.
Also please notify the sender by replying to this message, and then delete it from your system.

================================================================================


Re: Using email as username

Posted by Xiu <or...@libertysurf.fr>.

Raphaël Piéroni-3 wrote:
> 
> Hi,
> I would like to have the username equals the email for any user.
> I digged into the roller sources, but i can't find a way
> to customise the current behaviour. I think this is automatically 
> handled by acegy,
> but i don't know anything in spring/acegy yet.
> 

This is already more or less possible.

Since email should be unique and username has to be unique we could validate
this behaviour
(see 
http://www.nabble.com/is-email-address-of-a-user-in-roller-unique--tf3783455s12275.html
http://www.nabble.com/is-email-address-of-a-user-in-roller-unique--tf3783455s12275.html
)
Basic solution the way I see it would be to enable non alpha Numeric Chars
in roller.properties
(caution though the comment before this line says : 
# Characters to be allowed in user names (change at your own risk))
I have changed the line form 
username.allowedChars=A-Za-z0-9
to
username.allowedChars=A-Za-z0-9@._-
Wich allows most email addresses.

This enables creation of usernames that are emails.

If you want both to be equal then you should use a trigger on your database
to copy email to usernames (this should be done in rolleruser and userrole).
The main problem being since the unique constraint does not exist on the
email for now so the trigger could fail to succeed if the update attempted
to set 2 usernames to the same mail resulting in different data in username
and user email.

This would not break roller but would require for user to login with the old
email.

Hope this helps :)
-- 
View this message in context: http://www.nabble.com/Using-email-as-username-tf3790785s12275.html#a10759195
Sent from the Roller - User mailing list archive at Nabble.com.