Merge pull request #7211 from kinglozzer/migrate-legacy-hashes-config

Fix: Use Config API for MemberAuthenticator::$migrate_legacy_hashes (fixes #7208)
This commit is contained in:
Daniel Hensby 2017-07-26 11:21:51 +01:00 committed by GitHub
commit 2e34730d3d

View File

@ -161,9 +161,10 @@ class MemberAuthenticator extends Authenticator {
// when we can rehash passwords to a different hashing algorithm,
// bulk-migration doesn't work due to the nature of hashing.
// See PasswordEncryptor_LegacyPHPHash class.
if($success && $member && isset(self::$migrate_legacy_hashes[$member->PasswordEncryption])) {
$migrateLegacyHashes = self::config()->migrate_legacy_hashes;
if($success && $member && isset($migrateLegacyHashes[$member->PasswordEncryption])) {
$member->Password = $data['Password'];
$member->PasswordEncryption = self::$migrate_legacy_hashes[$member->PasswordEncryption];
$member->PasswordEncryption = $migrateLegacyHashes[$member->PasswordEncryption];
$member->write();
}