public function PhpassHashedPassword::userNeedsNewHash

Implements Drupal\Core\Password\PasswordInterface::userNeedsNewHash().

Overrides PasswordInterface::userNeedsNewHash

File

drupal/core/lib/Drupal/Core/Password/PhpassHashedPassword.php, line 251
Definition of Drupal\Core\Password\PhpassHashedPassword

Class

PhpassHashedPassword
Secure password hashing functions based on the Portable PHP password hashing framework.

Namespace

Drupal\Core\Password

Code

public function userNeedsNewHash($account) {

  // Check whether this was an updated password.
  if (substr($account->pass, 0, 3) != '$S$' || strlen($account->pass) != static::HASH_LENGTH) {
    return TRUE;
  }

  // Ensure that $count_log2 is within set bounds.
  $count_log2 = $this
    ->enforceLog2Boundaries($this->countLog2);

  // Check whether the iteration count used differs from the standard number.
  return $this
    ->getCountLog2($account->pass) !== $count_log2;
}