Skip to content

Commit

Permalink
cblue#426850 #4063 add a configuration option for password conversion…
Browse files Browse the repository at this point in the history
… during login if password encryption has changed
  • Loading branch information
renaudlemaire committed May 3, 2022
1 parent 331604a commit 68d72ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main/inc/lib/usermanager.lib.php
Expand Up @@ -169,7 +169,7 @@ public static function checkPassword($encoded, $raw, $salt, $userId)
$result = false;

$detectedEncryption = self::detectPasswordEncryption($encoded, $salt);
if (self::getPasswordEncryption() != $detectedEncryption) {
if (api_get_configuration_value('password_conversion') && self::getPasswordEncryption() != $detectedEncryption) {
$encoder = new \Chamilo\UserBundle\Security\Encoder($detectedEncryption);
$result = $encoder->isPasswordValid($encoded, $raw, $salt);
if ($result) {
Expand Down
2 changes: 2 additions & 0 deletions main/install/configuration.dist.php
Expand Up @@ -163,6 +163,8 @@
$_configuration['security_key'] = '{SECURITY_KEY}';
// Hash function method
$_configuration['password_encryption'] = '{ENCRYPT_PASSWORD}';
// allow to convert passwords after login if password_encryption has changed since last login
$_configuration['password_conversion'] = false;
// You may have to restart your web server if you change this
$_configuration['session_stored_in_db'] = false;
// Session lifetime
Expand Down

0 comments on commit 68d72ab

Please sign in to comment.