protected function verifyPassword($login, $password, $spiUser)
    {
        // In case of bcrypt let php's password functionality do it's magic
        if ($spiUser->hashAlgorithm === APIUser::PASSWORD_HASH_BCRYPT ||
            $spiUser->hashAlgorithm === APIUser::PASSWORD_HASH_PHP_DEFAULT) {
            return password_verify($password, $spiUser->passwordHash);
        }

        // Randomize login time to protect against timing attacks
        usleep(random_int(0, 30000));

        $passwordHash = $this->createPasswordHash(
            $login,
            $password,
            $this->settings['siteName'],
            $spiUser->hashAlgorithm
        );

        return $passwordHash === $spiUser->passwordHash;
    }
protected function verifyPassword($login, $password, $spiUser)
    {
        // In case of bcrypt let php's password functionality do it's magic
        if ($spiUser->hashAlgorithm === APIUser::PASSWORD_HASH_BCRYPT ||
            $spiUser->hashAlgorithm === APIUser::PASSWORD_HASH_PHP_DEFAULT) {
            return password_verify($password, $spiUser->passwordHash);
        }

        // Randomize login time to protect against timing attacks
        usleep(random_int(0, 30000));

        $passwordHash = $this->createPasswordHash(
            $login,
            $password,
            $this->settings['siteName'],
            $spiUser->hashAlgorithm
        );

        return $passwordHash === $spiUser->passwordHash;
    }
protected function verifyPassword ( $ login , $ password , $ spiUser ) { // In case of bcrypt let php's password functionality do it's magic if ( $ spiUser -> hashAlgorithm === APIUser :: PASSWORD_HASH_BCRYPT || $ spiUser -> hashAlgorithm === APIUser :: PASSWORD_HASH_PHP_DEFAULT ) { return password_verify ( $ password , $ spiUser -> passwordHash ) ; } // Randomize login time to protect against timing attacks usleep ( random_int ( 0 , 30000 ) ) ; $ passwordHash = $ this -> createPasswordHash ( $ login , $ password , $ this -> settings [ 'siteName' ] , $ spiUser -> hashAlgorithm ) ; return $ passwordHash === $ spiUser -> passwordHash ; }
Verifies if the provided login and password are valid.

@param string $login User login
@param string $password User password
@param \eZ\Publish\SPI\Persistence\User $spiUser Loaded user handler

@return bool return true if the login and password are sucessfully
validate and false, if not.
Verifies if the provided login and password are valid .