/**
* 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'));
}
}