You are here

public function MigratePassword::check in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/MigratePassword.php \Drupal\user\MigratePassword::check()

Check whether a plain text password matches a hashed password.

Parameters

string $password: A plain-text password

string $hash: A hashed password.

Return value

bool TRUE if the password is valid, FALSE if not.

Overrides PasswordInterface::check

File

core/modules/user/src/MigratePassword.php, line 44
Contains \Drupal\user\MigratePassword.

Class

MigratePassword
Replaces the original 'password' service in order to prefix the MD5 re-hashed passwords with the 'U' flag. The new salted hash is recreated on first login similarly to the D6->D7 upgrade path.

Namespace

Drupal\user

Code

public function check($password, $hash) {
  return $this->originalPassword
    ->check($password, $hash);
}