-
-
Save RyanABailey/3586ed29ac69af9ff59b to your computer and use it in GitHub Desktop.
Sitecore User Registration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static string Domain = "extranet"; | |
| public static void RegisterUser(string firstName, string lastName, string email, string password) | |
| { | |
| var userName = string.Format(@"{0}\{1}", Domain, email); | |
| try | |
| { | |
| if (!Sitecore.Security.Accounts.User.Exists(userName)) | |
| { | |
| Membership.CreateUser(userName, password, email); | |
| // Edit the profile information | |
| Sitecore.Security.Accounts.User user = Sitecore.Security.Accounts.User.FromName(userName, true); | |
| Sitecore.Security.UserProfile userProfile = user.Profile; | |
| userProfile.FullName = string.Format("{0} {1}", firstName, lastName); | |
| } | |
| } | |
| catch (Exception ex) | |
| { | |
| // log error | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment