Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Using Email instead of User Name for Registration and Login View modes: 
User avatar
Member
Member
Armysniper89 - 9/9/2010 3:20:35 PM
   
Using Email instead of User Name for Registration and Login
My site does not user Username. Instead in our current sites (non Kentico) we use Email Address as the account identifier. We find it to be a better way for users to remember their account. What is the best way to change the Logon Form and Custom Registration web parts to handle this? I can see in the Custom Registration that I can go to System Tables in Site Manager -> Development and change the Alternative Form for registration. But how would I point the Email address field to populate the Email and Username fields in the database? Do I need to customize the WebPart or is there some other easier way?

The Logon control also uses Username. I saw in another thread I would need to subclass that to change it from saying User Name since it uses a Localized Label so I am fine there.

My recommendation would be in the future, to support either as the key for login (Email or Username) since this would help give flexibility to people who dont use Username.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/13/2010 11:16:37 AM
   
RE:Using Email instead of User Name for Registration and Login
Hi,

You can use RegistrationForm web part for registering users on live site as this web part uses e-mail as username. If you would need to ensure this for Administration -> Users section you can ensure this by yourself in source code of 'new user' (User_New.aspx(.cs)) and 'edit user' (User_Edit_General.aspx(.cs)) pages.

If you already have users using username (like johny) and not e-mail address format and you would like to enable users to use both (username, email) to login, you can use custom security handler as described in below article:

http://devnet.kentico.com/docs/devguide/security_handler.htm

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Armysniper89 - 9/14/2010 1:23:28 PM
   
RE:Using Email instead of User Name for Registration and Login
Good to know that one works that way. What if I wanted to change the logon control? Is there an easy way to change it to say Email without going through too much? It uses a LocalizedLabel that I cannot set to a text value. Could I change that to a regular ASP.NET Label and not break things?

User avatar
Member
Member
Armysniper89 - 9/14/2010 2:37:20 PM
   
RE:Using Email instead of User Name for Registration and Login
I figured it out...I followed the docs here and created a custom.resx file added LogonForm.UserName and set it to "Email:" and then restarted the application and it worked:

http://devnet.kentico.com/docs/devguide/index.html?configuring_multilingual_ui.htm

Cookies for me!

User avatar
Member
Member
Aon_Vlado - 5/3/2012 2:28:10 PM
   
RE:Using Email instead of User Name for Registration and Login
What is the reason for validation for special characters and not allowing email address as user name in Administration -> Users -> Edit User -> General?
This is validation error in 5.5R2 when hitting OK.:

Please enter valid user name. The user name can contain only alphanumeric characters and some of special characters (_, -, ., @).

We are using email address as user names and did not have any other problems other than admin cannot edit data at General tab. Is this restriction really needed?

Thanks,

Vlado

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/3/2012 3:40:30 PM
   
RE:Using Email instead of User Name for Registration and Login
Hi,

Could you please let us know yoour exact version number as well as the steps how to reproduce the issue?

I am unable to reproduce it on my end - I tried both editing and creating new user with e-mail as user name and it is working fine.

Best regards,
Juraj Ondrus

User avatar
Member
Member
Aon_Vlado - 5/7/2012 6:47:24 PM
   
RE:Using Email instead of User Name for Registration and Login
Juraj,

Thank you for your answer. I found the reason for the error message:

I imported all users using my code and did not use trim(). The user names had spaces on the end which CMSDesk does not like even though users could login.