Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        /// <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));
        }
Esempio n. 3
0
        /// <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));
        }