diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2014-02-02 14:09:09 +0100 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2014-02-02 14:09:09 +0100 |
| commit | 292961a2771c9237197b9770b23a2a14a981c329 (patch) | |
| tree | 5c9eee5425d2dd1b7c85648d08098d1ec729bdd5 /phpBB/phpbb/passwords/manager.php | |
| parent | 85f1e8afa55356f620a8715ba9fcaaec491dff96 (diff) | |
| download | forums-292961a2771c9237197b9770b23a2a14a981c329.tar forums-292961a2771c9237197b9770b23a2a14a981c329.tar.gz forums-292961a2771c9237197b9770b23a2a14a981c329.tar.bz2 forums-292961a2771c9237197b9770b23a2a14a981c329.tar.xz forums-292961a2771c9237197b9770b23a2a14a981c329.zip | |
[feature/passwords] Get rid of set_name/get_name methods for passwords drivers
PHPBB3-11610
Diffstat (limited to 'phpBB/phpbb/passwords/manager.php')
| -rw-r--r-- | phpBB/phpbb/passwords/manager.php | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/phpBB/phpbb/passwords/manager.php b/phpBB/phpbb/passwords/manager.php index 539fdca954..7aeb496eb5 100644 --- a/phpBB/phpbb/passwords/manager.php +++ b/phpBB/phpbb/passwords/manager.php @@ -79,7 +79,7 @@ class manager { if ($this->algorithms[$type]->is_supported()) { - $this->type = $type; + $this->type = $this->algorithms[$type]->get_prefix(); break; } } @@ -94,16 +94,12 @@ class manager { foreach ($hashing_algorithms as $algorithm) { - if (!isset($this->algorithms[$algorithm->get_name()])) - { - $this->algorithms[$algorithm->get_name()] = $algorithm; - } - if (!isset($this->type_map[$algorithm->get_prefix()])) { - $this->type_map[$algorithm->get_prefix()] = $algorithm->get_name(); + $this->type_map[$algorithm->get_prefix()] = $algorithm; } } + $this->algorithms = $hashing_algorithms; } /** @@ -130,9 +126,9 @@ class manager */ protected function get_algorithm($prefix) { - if (isset($this->type_map[$prefix]) && isset($this->algorithms[$this->type_map[$prefix]])) + if (isset($this->type_map[$prefix])) { - return $this->algorithms[$this->type_map[$prefix]]; + return $this->type_map[$prefix]; } else { @@ -216,9 +212,9 @@ class manager return $this->helper->combined_hash_password($password, $type); } - if (isset($this->algorithms[$type])) + if (isset($this->type_map[$type])) { - $hashing_algorithm = $this->algorithms[$type]; + $hashing_algorithm = $this->type_map[$type]; } else { @@ -260,7 +256,7 @@ class manager return $correct; } - if ($stored_hash_type->get_name() !== $this->type) + if ($stored_hash_type->get_prefix() !== $this->type) { $this->convert_flag = true; } |
