コード例 #1
0
ファイル: PasswordForm.php プロジェクト: jarick/bx
 /**
  * Check old password
  *
  * @param string $value
  */
 public function validateOld($value)
 {
     $hash = User::getHashPasswordByUserID($this->getValue(self::C_USER_ID));
     if ($hash === false) {
         return $this->trans('user.form.password.bad_old_password');
     }
     if (!User::checkPasswordByHash($value, $hash)) {
         return $this->trans('user.form.password.bad_old_password');
     }
 }
コード例 #2
0
ファイル: AccessForm.php プロジェクト: jarick/bx
 /**
  * Check old password
  *
  * @param string $value
  */
 public function validatePassword(&$value)
 {
     if ($this->user !== null) {
         $hash = User::getHashPasswordByUserID($this->user->id);
         if ($hash === false) {
             return $this->trans('user.form.access_form.bad_password');
         }
         $value = User::getHashPassword($value);
         if (!User::checkPasswordByHash($value, $hash)) {
             return $this->trans('user.form.access_form.bad_password');
         }
     }
 }