src/wcmf/application/controller/UserController.php
protected function changePasswordImpl(User $user, $oldPassword, $newPassword, $newPasswordRepeated) {
    $message = $this->getMessage();
    // check old password
    if (!$user->verifyPassword($oldPassword)) {
      throw new IllegalArgumentException($message->getText("The old password is incorrect"));
    }
    if (strlen($newPassword) == 0) {
      throw new IllegalArgumentException($message->getText("The password can't be empty"));
    }
    if ($newPassword != $newPasswordRepeated) {
      throw new IllegalArgumentException($message->getText("The given passwords don't match"));
    }
    // set password
    $user->setPassword($newPassword);
  }
protected function changePasswordImpl(User $user, $oldPassword, $newPassword, $newPasswordRepeated) {
    $message = $this->getMessage();
    // check old password
    if (!$user->verifyPassword($oldPassword)) {
      throw new IllegalArgumentException($message->getText("The old password is incorrect"));
    }
    if (strlen($newPassword) == 0) {
      throw new IllegalArgumentException($message->getText("The password can't be empty"));
    }
    if ($newPassword != $newPasswordRepeated) {
      throw new IllegalArgumentException($message->getText("The given passwords don't match"));
    }
    // set password
    $user->setPassword($newPassword);
  }
protected function changePasswordImpl ( User $ user , $ oldPassword , $ newPassword , $ newPasswordRepeated ) { $ message = $ this -> getMessage ( ) ; // check old password if ( ! $ user -> verifyPassword ( $ oldPassword ) ) { throw new IllegalArgumentException ( $ message -> getText ( "The old password is incorrect" ) ) ; } if ( strlen ( $ newPassword ) == 0 ) { throw new IllegalArgumentException ( $ message -> getText ( "The password can't be empty" ) ) ; } if ( $ newPassword != $ newPasswordRepeated ) { throw new IllegalArgumentException ( $ message -> getText ( "The given passwords don't match" ) ) ; } // set password $ user -> setPassword ( $ newPassword ) ; }
Change a users password.
@param $user The User instance
@param $oldPassword The old password of the user
@param $newPassword The new password for the user
@param $newPasswordRepeated The new password of the user again
Change a users password .