Skip to content

Commit

Permalink
Resolving comments:
Browse files Browse the repository at this point in the history
- password history check disable by default.
- added french translation.
- readable variable names.
  • Loading branch information
abpai94 committed Sep 16, 2024
1 parent 65dfcd2 commit 935e7a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conf/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

# Features
$use_checkpassword = true;
$use_checkpasswordhistory = true;
$use_checkpasswordhistory = false;
$use_resetpassword = true;
$use_resetpassword_resetchoice = true;
$resetpassword_reset_default = true;
Expand Down
10 changes: 5 additions & 5 deletions htdocs/checkpassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
$result = $ldap_connection[1];

if ($use_checkpasswordhistory) {
$hashed_password_history = $ldapInstance->get_attribute_values($dn, "pwdHistory");
foreach ($hashed_password_history as $hashed_password) {
preg_match("/(?<={).*(?=})/", $hashed_password, $algorithm);
preg_match("/{(?<={).*/", $hashed_password, $password_hash);
if (\Ltb\Password::check_password($password, $password_hash[0], $algorithm[0])) {
$password_history = $ldapInstance->get_attribute_values($dn, "pwdHistory");
foreach ($password_history as $previous_password) {
preg_match("/(?<={).*(?=})/", $previous_password, $algorithm);
preg_match("/{(?<={).*/", $previous_password, $hash);
if (\Ltb\Password::check_password($password, $hash[0], $algorithm[0])) {
$result = "passwordinhistory";
}
}
Expand Down
1 change: 1 addition & 0 deletions lang/fr.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
$messages['passwordinvalid'] = "Authentification en échec";
$messages['passwordok'] = "Authentification réussie !";
$messages['passwordrefused'] = "Le mot de passe a été refusé";
$messages['passwordinhistory'] = "Mot de passe déjà dans l'histoire";
$messages['passwordrequired'] = "Merci de saisir le mot de passe";
$messages['resetpassword'] = "Réinitialisation du mot de passe";
$messages['search'] = "Rechercher";
Expand Down

0 comments on commit 935e7a8

Please sign in to comment.