From 2ea45a06e724dfe9c3248fbb659d86558b55265e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Apr 2014 21:00:33 +0200 Subject: [ticket/12352] Add legacy passwords driver for sha1 smf type passwords PHPBB3-12352 --- phpBB/phpbb/passwords/driver/base.php | 8 ++++ phpBB/phpbb/passwords/driver/driver_interface.php | 7 +++ phpBB/phpbb/passwords/driver/sha1_smf.php | 58 +++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 phpBB/phpbb/passwords/driver/sha1_smf.php (limited to 'phpBB/phpbb/passwords/driver') diff --git a/phpBB/phpbb/passwords/driver/base.php b/phpBB/phpbb/passwords/driver/base.php index fffc9d1461..b74c2d3d72 100644 --- a/phpBB/phpbb/passwords/driver/base.php +++ b/phpBB/phpbb/passwords/driver/base.php @@ -43,4 +43,12 @@ abstract class base implements driver_interface { return true; } + + /** + * @inheritdoc + */ + public function is_legacy() + { + return false; + } } diff --git a/phpBB/phpbb/passwords/driver/driver_interface.php b/phpBB/phpbb/passwords/driver/driver_interface.php index 54c9d6500e..d38681b75f 100644 --- a/phpBB/phpbb/passwords/driver/driver_interface.php +++ b/phpBB/phpbb/passwords/driver/driver_interface.php @@ -22,6 +22,13 @@ interface driver_interface */ public function is_supported(); + /** + * Check if hash type is a legacy hash type + * + * @return bool True if it's a legacy hash type, false if not + */ + public function is_legacy(); + /** * Returns the hash prefix * diff --git a/phpBB/phpbb/passwords/driver/sha1_smf.php b/phpBB/phpbb/passwords/driver/sha1_smf.php new file mode 100644 index 0000000000..f7f5587485 --- /dev/null +++ b/phpBB/phpbb/passwords/driver/sha1_smf.php @@ -0,0 +1,58 @@ +hash($password, $user_row); + } + + /** + * @inheritdoc + */ + public function get_settings_only($hash, $full = false) + { + return false; + } +} -- cgit v1.2.1