Fix: Use Config API for MemberAuthenticator::$migrate_legacy_hashes (fixes #7208)

This commit is contained in:
Loz Calver 2017-07-26 09:53:54 +01:00
parent ba8c149b78
commit 82c0632f46
No known key found for this signature in database
GPG Key ID: F91FFC2D7E0CAEDB

View File

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