You are here

function MoAuthPasswordValidator::isPasswordUnique in Google Authenticator / 2 Factor Authentication - 2FA 7

File

classes/MoAuthPasswordValidator.php, line 19

Class

MoAuthPasswordValidator

Code

function isPasswordUnique() {
  $lastNPasswords = $this
    ->lastNPasswordsInDB();
  foreach ($lastNPasswords as $key => $value) {
    $tempuser = $this->user;
    $tempuser->pass = $value->pass;
    if (user_check_password($this->plainPassword, $tempuser)) {
      return FALSE;
    }
  }
  return TRUE;
}