Piwik\Auth\Password::info PHP Method

info() public method

..). Can be used to verify whether a string is compatible with password_hash().
public info ( $hash ) : array
return array
    public function info($hash)
    {
        return password_get_info($hash);
    }

Usage Example

Beispiel #1
0
 /**
  * Checks the password hash that was retrieved from the Option table. Used as a sanity check
  * when finishing the reset password process. If a password is obviously malformed, changing
  * a user's password to it will keep the user from being able to login again.
  *
  * Derived classes can override this method to provide fewer or more checks.
  *
  * @param string $passwordHash The password hash to check.
  * @throws Exception if the password hash length is incorrect.
  */
 protected function checkPasswordHash($passwordHash)
 {
     $hashInfo = $this->passwordHelper->info($passwordHash);
     if (!isset($hashInfo['algo']) || 0 >= $hashInfo['algo']) {
         throw new Exception(Piwik::translate('Login_ExceptionPasswordMD5HashExpected'));
     }
 }
All Usage Examples Of Piwik\Auth\Password::info