mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[feature/passwords] Get rid of set_name/get_name methods for passwords drivers
PHPBB3-11610
This commit is contained in:
@@ -42,22 +42,4 @@ abstract class base implements driver_interface
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_name()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set driver name
|
||||
*
|
||||
* @param string $name Driver name
|
||||
*/
|
||||
public function set_name($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
}
|
||||
|
@@ -57,11 +57,4 @@ interface driver_interface
|
||||
* @return string String containing the hash settings
|
||||
*/
|
||||
public function get_settings_only($hash, $full = false);
|
||||
|
||||
/**
|
||||
* Get the driver name
|
||||
*
|
||||
* @return string Driver name
|
||||
*/
|
||||
public function get_name();
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user