public static void Initialize(UserGroupManager userMgr) { userMgr.AddUser(AdminUser); userMgr.AddUser(GuestUser); userMgr.AddGroup(AdminGroup); userMgr.AddGroup(GuestGroup); }
public static void createSSAEktronMember(string PIN) { //try //{ Dictionary<string, string> UserDetails = loginSSA.GetUsersDetails(PIN); UserManager Usermanager = new UserManager(); CustomAttributeList attrList = new CustomAttributeList(); CustomAttribute timeZone = new CustomAttribute(); timeZone.Name = "Time Zone"; timeZone.Value = "Eastern Standard Time"; attrList.Add(timeZone); UserData newUserdata = new UserData() { Username = PIN, Password = EktronMemberDefaultPassword, FirstName = UserDetails["FirstName"], LastName = UserDetails["LastName"], DisplayName = UserDetails["DisplayName"], Email = UserDetails["Email"], CustomProperties = attrList, // IsMemberShip = true }; if (Ektron.Cms.Framework.Context.UserContextService.Current.IsLoggedIn) { Usermanager.Add(newUserdata); // add user to group MSBA Members UserGroupManager UserGroupmanager = new UserGroupManager(); //Add a User to a UserGroup UserGroupmanager.AddUser(1, newUserdata.Id); } //} //catch { } }