public void ChangePassword(User user, string newPasswordHash, string oldPasswordHash) { Contract.Requires(ActionPermitted(SystemAction.ChangeOwnPassword)); Contract.Requires(this.CorrectUser(user)); this.TestPermission(SystemAction.ChangeOwnPassword, "You don't have permission to change your own password"); this.TestCorrectUser(user); _dao.ChangePassword(user, newPasswordHash, oldPasswordHash); }
/// <summary> /// Changes the password of this user /// </summary> /// <param name="newPwd">The new password</param> /// <returns>Was it succesful?</returns> public void ChangePassword(string newPwd) { IDataAccessObject dao = DAOFactory.CurrentUserDAO; dao.ChangePassword(this, HashPassword(newPwd)); }
/// <summary> /// Changes the password of this user /// </summary> /// <param name="oldPwd">The old password</param> /// <param name="newPwd">The new password</param> /// <returns>Was it succesful?</returns> public void ChangePassword(string oldPwd, string newPwd) { IDataAccessObject dao = DAOFactory.getDAO(this); dao.ChangePassword(this, HashPassword(newPwd), HashPassword(oldPwd)); }