public override string CreateAccount(string userName, string password, bool requireConfirmationToken) { var account = new LocalUser { UserName = userName, Password = PasswordUtiltity.OneWayHash(password) }; _userDao.Insert(account); return(userName); }
public override string CreateUserAndAccount(string userName, string password, bool requireConfirmation, IDictionary <string, object> values) { var account = new LocalUser { UserName = userName, Password = PasswordUtiltity.OneWayHash(password) }; _userDao.Insert(account); return(userName); }
public override bool ChangePassword(string username, string oldPassword, string newPassword) { var account = _userDao.LoadByUserName(username); if (account == null) { return(false); } if (PasswordUtiltity.PasswordMatch(oldPassword, account.Password)) { account.Password = PasswordUtiltity.OneWayHash(newPassword); _userDao.UpdateAccount(account); } return(false); }
public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status) { var account = new LocalUser { Email = email, IsApproved = true, Password = PasswordUtiltity.OneWayHash(password), PasswordAnswer = passwordAnswer, PasswordQuestion = passwordQuestion, ProviderUserKey = providerUserKey, UserName = username, }; //repo.add status = MembershipCreateStatus.Success; return(GetUser(username, userIsOnline: true)); }