public static CreateUserStatus Create(HiMembershipUser userToCreate, string passwordQuestion, string passwordAnswer, string[] roles) { CreateUserStatus result; if (userToCreate == null) { result = CreateUserStatus.UnknownFailure; } else { MemberUserProvider memberUserProvider = MemberUserProvider.Instance(); try { CreateUserStatus createUserStatus = memberUserProvider.CreateMembershipUser(userToCreate, passwordQuestion, passwordAnswer); if (createUserStatus == CreateUserStatus.Created) { Roles.AddUserToRoles(userToCreate.Username, roles); } } catch (CreateUserException ex) { result = ex.CreateUserStatus; return(result); } result = CreateUserStatus.Created; } return(result); }
public bool ChangePasswordQuestionAndAnswer(string newQuestion, string newAnswer) { bool result; if (string.IsNullOrEmpty(newQuestion) || string.IsNullOrEmpty(newAnswer)) { result = false; } else { if (newQuestion.Length > 256 || newAnswer.Length > 128) { result = false; } else { if (!string.IsNullOrEmpty(this.PasswordQuestion)) { result = false; } else { MemberUserProvider memberUserProvider = MemberUserProvider.Instance(); result = memberUserProvider.ChangePasswordQuestionAndAnswer(this.Username, newQuestion, newAnswer); } } } return(result); }
public static bool UpdateUser(HiMembershipUser user) { if (user == null) { return(false); } return(MemberUserProvider.Instance().UpdateMembershipUser(user)); }
public virtual bool ChangePasswordQuestionAndAnswer(string oldAnswer, string newQuestion, string newAnswer) { if (string.IsNullOrEmpty(newQuestion) || string.IsNullOrEmpty(newAnswer)) { return(false); } if ((newQuestion.Length > 0x100) || (newAnswer.Length > 0x80)) { return(false); } return(this.ValidatePasswordAnswer(oldAnswer) && MemberUserProvider.Instance().ChangePasswordQuestionAndAnswer(this.Username, newQuestion, newAnswer)); }
public static bool UpdateUser(HiMembershipUser user) { bool result; if (user == null) { result = false; } else { MemberUserProvider memberUserProvider = MemberUserProvider.Instance(); result = memberUserProvider.UpdateMembershipUser(user); } return(result); }
public static CreateUserStatus Create(HiMembershipUser userToCreate, string passwordQuestion, string passwordAnswer, string[] roles) { if (userToCreate == null) { return CreateUserStatus.UnknownFailure; } MemberUserProvider provider = MemberUserProvider.Instance(); try { if (provider.CreateMembershipUser(userToCreate, passwordQuestion, passwordAnswer) == CreateUserStatus.Created) { Roles.AddUserToRoles(userToCreate.Username, roles); } } catch (CreateUserException exception) { return exception.CreateUserStatus; } return CreateUserStatus.Created; }
public static int GetUserIdByEmail(string email) { return(MemberUserProvider.Instance().GetUserIdByEmail(email)); }
public static HiMembershipUser GetMembershipUser(int userId, string username, bool userIsOnline) { MemberUserProvider memberUserProvider = MemberUserProvider.Instance(); return(memberUserProvider.GetMembershipUser(userId, username, userIsOnline)); }
public static bool BindOpenId(string username, string openId, string openIdType) { return(MemberUserProvider.Instance().BindOpenId(username, openId, openIdType)); }
public virtual bool ValidatePasswordAnswer(string answer) { return(MemberUserProvider.Instance().ValidatePasswordAnswer(this.Username, answer)); }
public static string GetUsernameWithOpenId(string openId, string openIdType) { return(MemberUserProvider.Instance().GetUsernameWithOpenId(openId, openIdType)); }
public static bool IsExistEmal(string email) { return(MemberUserProvider.Instance().IsExistEmal(email)); }
public static int GetUserIdBySessionId(string sessionid) { return(MemberUserProvider.Instance().GetUserIdBySessionId(sessionid)); }
public static int GetUserIdByOpenId(string openId, string OpenIdType) { return(MemberUserProvider.Instance().GetUserIdByOpenId(openId, OpenIdType)); }
public static int GetUserIdByAliPayOpenId(string openId) { return(MemberUserProvider.Instance().GetUserIdByAliPayOpenId(openId)); }
public static bool IsExistUserName(int userid, string userName) { return(MemberUserProvider.Instance().IsExistUserName(userid, userName)); }
public static string UpdateSessionId(int userId) { return(MemberUserProvider.Instance().UpdateSessionId(userId)); }