diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-09-20 17:31:32 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-09-20 17:31:32 +0200 |
commit | a00854c406215d787465422d7ea7def8c24180f5 (patch) | |
tree | 0e8352afe2bdf9d6cca276668da2302fee89321d /phpBB/phpbb/passwords/helper.php | |
parent | beafef00004007024d3c8c769d630d7d5ec9b698 (diff) | |
download | forums-a00854c406215d787465422d7ea7def8c24180f5.tar forums-a00854c406215d787465422d7ea7def8c24180f5.tar.gz forums-a00854c406215d787465422d7ea7def8c24180f5.tar.bz2 forums-a00854c406215d787465422d7ea7def8c24180f5.tar.xz forums-a00854c406215d787465422d7ea7def8c24180f5.zip |
[feature/passwords] Do not pass phpbb_container to passwords manager
PHPBB3-11610
Diffstat (limited to 'phpBB/phpbb/passwords/helper.php')
-rw-r--r-- | phpBB/phpbb/passwords/helper.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/phpBB/phpbb/passwords/helper.php b/phpBB/phpbb/passwords/helper.php index 952f491669..d91edb90a1 100644 --- a/phpBB/phpbb/passwords/helper.php +++ b/phpBB/phpbb/passwords/helper.php @@ -26,20 +26,13 @@ class phpbb_passwords_helper protected $manager; /** - * @var phpbb_container - */ - protected $container; - - /** * Construct a phpbb_passwords_helper object * * @param phpbb_passwords_manager $manager Crypto manager object - * @param phpbb_container $container phpBB container object */ - public function __construct($manager, $container) + public function __construct($manager) { $this->manager = $manager; - $this->container = $container; } /** @@ -85,14 +78,22 @@ class phpbb_passwords_helper $hash = $hash_settings[0]; // Put settings of current hash into data array - $stored_hash_type = $this->manager->get_hashing_algorithm($password_hash); + $stored_hash_type = $this->manager->detect_algorithm($password_hash); $this->combine_hash_output($data, 'prefix', $stored_hash_type->get_prefix()); $this->combine_hash_output($data, 'settings', $stored_hash_type->get_settings_only($password_hash)); // Hash current hash with the defined types foreach ($type as $cur_type) { - $new_hash_type = $this->container->get($cur_type); + if (isset($this->manager->algorithms[$cur_type])) + { + $new_hash_type = $this->manager->algorithms[$cur_type]; + } + else + { + return false; + } + $new_hash = $new_hash_type->hash(str_replace($stored_hash_type->get_settings_only($password_hash), '', $hash)); $this->combine_hash_output($data, 'prefix', $new_hash_type->get_prefix()); $this->combine_hash_output($data, 'settings', substr(str_replace('$', '\\', $new_hash_type->get_settings_only($new_hash, true)), 0)); |