public static LoginUserStatus ValidateUser(HiMembershipUser user) { LoginUserStatus result; if (user == null) { result = LoginUserStatus.UnknownError; } else { if (!user.IsApproved) { result = LoginUserStatus.AccountPending; } else { if (user.IsLockedOut) { result = LoginUserStatus.AccountLockedOut; } else { if (!HiMembership.ValidateUser(user.Username, user.Password)) { result = LoginUserStatus.InvalidCredentials; } else { result = LoginUserStatus.Success; } } } } return(result); }
public static MembershipUser Create(string username, string password, string email) { MembershipUser membershipUser = null; CreateUserStatus createUserStatus = CreateUserStatus.UnknownFailure; try { if (!string.IsNullOrEmpty(email)) { membershipUser = System.Web.Security.Membership.CreateUser(username, password, email); createUserStatus = ((membershipUser == null) ? CreateUserStatus.UnknownFailure : CreateUserStatus.Created); } else { membershipUser = System.Web.Security.Membership.CreateUser(username, password); createUserStatus = ((membershipUser == null) ? CreateUserStatus.UnknownFailure : CreateUserStatus.Created); } } catch (MembershipCreateUserException ex) { createUserStatus = HiMembership.GetCreateUserStatus(ex.StatusCode); } catch (Exception exception_) { createUserStatus = HiMembership.GetCreateUserStatus(exception_); } if (createUserStatus != CreateUserStatus.Created) { throw new CreateUserException(createUserStatus); } return(membershipUser); }
public static CreateUserStatus GetCreateUserStatus(Exception exception_0) { MembershipCreateUserException ex = exception_0 as MembershipCreateUserException; CreateUserStatus result; if (ex != null) { result = HiMembership.GetCreateUserStatus(ex.StatusCode); } else { result = CreateUserStatus.UnknownFailure; } return(result); }
public static LoginUserStatus ValidateUser(HiMembershipUser user) { if (user == null) { return(LoginUserStatus.UnknownError); } if (!user.IsApproved) { return(LoginUserStatus.AccountPending); } if (user.IsLockedOut) { return(LoginUserStatus.AccountLockedOut); } if (!HiMembership.ValidateUser(user.Username, user.Password)) { return(LoginUserStatus.InvalidCredentials); } return(LoginUserStatus.Success); }
public static MembershipUser GetUser(string username) { return(HiMembership.GetUser(username, false)); }
public static MembershipUser GetUser(object userId) { return(HiMembership.GetUser(userId, false)); }