diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-05-28 21:03:17 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-06-01 21:31:05 +0200 |
commit | af25aef04ca3ee39cd1597b356638e883ccf72fa (patch) | |
tree | 6fd92cb452af622566b07d16221b7c6a13ef48d6 /phpBB | |
parent | dc5a5a7cdfae8ba8e300b7db46eaa64fcc70824c (diff) | |
download | forums-af25aef04ca3ee39cd1597b356638e883ccf72fa.tar forums-af25aef04ca3ee39cd1597b356638e883ccf72fa.tar.gz forums-af25aef04ca3ee39cd1597b356638e883ccf72fa.tar.bz2 forums-af25aef04ca3ee39cd1597b356638e883ccf72fa.tar.xz forums-af25aef04ca3ee39cd1597b356638e883ccf72fa.zip |
[ticket/12352] Add driver for myBB md5 passwords
PHPBB3-12352
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/config/passwords.yml | 8 | ||||
-rw-r--r-- | phpBB/phpbb/passwords/driver/md5_mybb.php | 59 |
2 files changed, 67 insertions, 0 deletions
diff --git a/phpBB/config/passwords.yml b/phpBB/config/passwords.yml index f712e84b42..4b89d5d81a 100644 --- a/phpBB/config/passwords.yml +++ b/phpBB/config/passwords.yml @@ -72,6 +72,14 @@ services: tags: - { name: passwords.driver } + passwords.driver.md5_mybb: + class: phpbb\passwords\driver\md5_mybb + arguments: + - @config + - @passwords.driver_helper + tags: + - { name: passwords.driver } + passwords.driver_collection: class: phpbb\di\service_collection arguments: diff --git a/phpBB/phpbb/passwords/driver/md5_mybb.php b/phpBB/phpbb/passwords/driver/md5_mybb.php new file mode 100644 index 0000000000..9406546798 --- /dev/null +++ b/phpBB/phpbb/passwords/driver/md5_mybb.php @@ -0,0 +1,59 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +namespace phpbb\passwords\driver; + +/** +* @package passwords +*/ +class md5_mybb extends base +{ + const PREFIX = '$md5_mybb$'; + + /** + * @inheritdoc + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * @inheritdoc + */ + public function is_legacy() + { + return true; + } + + /** + * @inheritdoc + */ + public function hash($password, $user_row = '') + { + // Do not support hashing + return false; + } + + /** + * @inheritdoc + */ + public function check($password, $hash, $user_row = array()) + { + return (!empty($hash) && isset($user_row['user_passwd_salt'])) ? $hash === md5($user_row['user_passwd_salt'] . md5($password)) : false; + } + + /** + * @inheritdoc + */ + public function get_settings_only($hash, $full = false) + { + return false; + } +} |