1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 07:07:51 +02:00

[feature/passwords] Add get_name() method to drivers

This will allow us to actually properly differentiate between the available
drivers.

PHPBB3-11610
This commit is contained in:
Marc Alexander 2013-08-21 16:31:57 -05:00
parent df8e5f4c3c
commit 58755c4972
3 changed files with 36 additions and 0 deletions

View File

@ -3,6 +3,8 @@ services:
class: phpbb_crypto_driver_bcrypt
arguments:
- @config
calls:
- [set_name, [crypto.driver.bcrypt]]
tags:
- { name: crypto.driver }
@ -10,6 +12,8 @@ services:
class: phpbb_crypto_driver_bcrypt_2y
arguments:
- @config
calls:
- [set_name, [crypto.driver.bcrypt_2y]]
tags:
- { name: crypto.driver }
@ -17,6 +21,8 @@ services:
class: phpbb_crypto_driver_salted_md5
arguments:
- @config
calls:
- [set_name, [crypto.driver.salted_md5]]
tags:
- { name: crypto.driver }
@ -24,6 +30,8 @@ services:
class: phpbb_crypto_driver_phpass
arguments:
- @config
calls:
- [set_name, [crypto.driver.phpass]]
tags:
- { name: crypto.driver }

View File

@ -26,6 +26,9 @@ abstract class phpbb_crypto_driver_base implements phpbb_crypto_driver_interface
/** @var phpbb_crypto_driver_helper */
protected $helper;
/** @var driver name */
protected $name;
/**
* Constructor of crypto driver object
*
@ -44,4 +47,22 @@ abstract class phpbb_crypto_driver_base implements phpbb_crypto_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;
}
}

View File

@ -65,4 +65,11 @@ interface phpbb_crypto_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();
}