I see that it is possible to change a member's username in the back-end.
My client wants to use email addresses as usernames, therefore if a member changes their email address on the website I need to run a bit of code to change their username too.
Does anyone know how I can hook into the provider code that's used in the back-end to do this? I'm imagining that would be the simplest thing to do?
Changing a member's username
I see that it is possible to change a member's username in the back-end.
My client wants to use email addresses as usernames, therefore if a member changes their email address on the website I need to run a bit of code to change their username too.
Does anyone know how I can hook into the provider code that's used in the back-end to do this?
I'm imagining that would be the simplest thing to do?
Regards,
Matt
Where do you want to change it, from code or from backend?
Hi Scott,
Sorry for the delay in getting back to you. I was at CG12 and wanted to check my solution back in the office before replying.
I found it was quite easy to change the username using the 'original' Membership API.
umbraco.cms.businesslogic.member.Member uMember = umbraco.cms.businesslogic.member.Member.GetMemberFromLoginName(currentUsername);
uMember.LoginName = newUsername;
uMember.Save();
Regards,
Matt
is working on a reply...