Piwik\Auth\Password::verify PHP Method

verify() public method

This method expects the password to be pre-hashed by \Piwik\Plugins\UsersManager\UsersManager::getPasswordHash().
public verify ( string $password, string $hash ) : boolean
$password string
$hash string
return boolean
    public function verify($password, $hash)
    {
        return password_verify($password, $hash);
    }

Usage Example

Beispiel #1
0
 private function authenticateWithPassword($login, $passwordHash)
 {
     $user = $this->userModel->getUser($login);
     if (empty($user['login'])) {
         return new AuthResult(AuthResult::FAILURE, $login, null);
     }
     if ($this->passwordHelper->verify($passwordHash, $user['password'])) {
         if ($this->passwordHelper->needsRehash($user['password'])) {
             $newPasswordHash = $this->passwordHelper->hash($passwordHash);
             $this->userModel->updateUser($login, $newPasswordHash, $user['email'], $user['alias'], $user['token_auth']);
         }
         return $this->authenticationSuccess($user);
     }
     return new AuthResult(AuthResult::FAILURE, $login, null);
 }
All Usage Examples Of Piwik\Auth\Password::verify