[feature/passwords] Add convert flag for converting to default

PHPBB3-11610
This commit is contained in:
Marc Alexander 2013-06-15 12:10:56 +02:00
parent d3d317a2de
commit 8795fe9c77

View file

@ -30,6 +30,11 @@ class phpbb_crypto_manager
*/ */
protected $type_map = false; protected $type_map = false;
/**
* Password convert flag. Password should be converted
*/
public $convert_flag = false;
/** /**
* Crypto helper * Crypto helper
* @var phpbb_crypto_helper * @var phpbb_crypto_helper
@ -183,18 +188,14 @@ class phpbb_crypto_manager
// Multiple hash passes needed // Multiple hash passes needed
if (is_array($stored_hash_type)) if (is_array($stored_hash_type))
{ {
return $this->helper->check_combined_hash($password, $stored_hash_type, $hash); return $this->helper->check_combined_hash($password, $stored_hash_type, $hash);
} }
return $stored_hash_type->check($password, $hash);
if ($stored_hash_type->get_type() !== $this->type) if ($stored_hash_type->get_type() !== $this->type)
{ {
// check with "old" hash and convert to new one $this->convert_flag = true;
}
else
{
// check with default type
} }
return $stored_hash_type->check($password, $hash);
} }
} }