diff --git a/htdocs/display.php b/htdocs/display.php index 8413070..67c9efa 100644 --- a/htdocs/display.php +++ b/htdocs/display.php @@ -96,8 +96,8 @@ # Get password policy configuration $pwdPolicyConfiguration = $directory->getPwdPolicyConfiguration($ldap, $dn, $ldap_default_ppolicy); - if ($ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_durantion; } - if ($ldap_password_max_age) { $pwdPolicyConfiguration['password_max_age'] = $ldap_password_max_age; } + if (isset($ldap_lockout_duration) and $ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_duration; } + if (isset($ldap_password_max_age) and $ldap_password_max_age) { $pwdPolicyConfiguration['password_max_age'] = $ldap_password_max_age; } if ($display_edit_link) { # Replace {dn} in URL diff --git a/htdocs/index.php b/htdocs/index.php index a925cc5..e563200 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -130,6 +130,12 @@ $smarty->setCompileDir($compile_dir); $smarty->setCacheDir($cache_dir); $smarty->debugging = $smarty_debug; +function sha256($string) +{ + return hash("sha256",$string); +} +$smarty->registerPlugin("modifier","sha256", "sha256"); +$smarty->registerPlugin("modifier","is_array", "is_array"); if(isset($smarty_debug) && $smarty_debug == true ) { diff --git a/htdocs/lockaccount.php b/htdocs/lockaccount.php index ea0207a..c094a53 100644 --- a/htdocs/lockaccount.php +++ b/htdocs/lockaccount.php @@ -37,7 +37,7 @@ { # Get password policy configuration $pwdPolicyConfiguration = $directory->getPwdPolicyConfiguration($ldap, $dn, $ldap_default_ppolicy); - if ($ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_durantion; } + if ($ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_duration; } if ($ldap_password_max_age) { $pwdPolicyConfiguration['password_max_age'] = $ldap_password_max_age; } # Apply the modification only the password can be locked diff --git a/htdocs/searchexpired.php b/htdocs/searchexpired.php index 8676733..658f3e0 100644 --- a/htdocs/searchexpired.php +++ b/htdocs/searchexpired.php @@ -15,8 +15,8 @@ # Get password policy configuration $pwdPolicyConfiguration = $directory->getPwdPolicyConfiguration($ldap, $entry["dn"], $ldap_default_ppolicy); - if ($ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_durantion; } - if ($ldap_password_max_age) { $pwdPolicyConfiguration['password_max_age'] = $ldap_password_max_age; } + if (isset($ldap_lockout_duration) and $ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_duration; } + if (isset($ldap_password_max_age) and $ldap_password_max_age) { $pwdPolicyConfiguration['password_max_age'] = $ldap_password_max_age; } $isExpired = $directory->isPasswordExpired($ldap, $entry["dn"], $pwdPolicyConfiguration); diff --git a/htdocs/searchlocked.php b/htdocs/searchlocked.php index 8b10b35..f16edfc 100644 --- a/htdocs/searchlocked.php +++ b/htdocs/searchlocked.php @@ -16,8 +16,8 @@ # Get password policy configuration $pwdPolicyConfiguration = $directory->getPwdPolicyConfiguration($ldap, $entry["dn"], $ldap_default_ppolicy); - if ($ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_durantion; } - if ($ldap_password_max_age) { $pwdPolicyConfiguration['password_max_age'] = $ldap_password_max_age; } + if (isset($ldap_lockout_duration) and $ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_duration; } + if (isset($ldap_password_max_age) and $ldap_password_max_age) { $pwdPolicyConfiguration['password_max_age'] = $ldap_password_max_age; } $isLocked = $directory->isLocked($ldap, $entry['dn'], $pwdPolicyConfiguration); diff --git a/htdocs/searchwillexpire.php b/htdocs/searchwillexpire.php index 75c609d..2f9523d 100644 --- a/htdocs/searchwillexpire.php +++ b/htdocs/searchwillexpire.php @@ -15,8 +15,8 @@ # Get password policy configuration $pwdPolicyConfiguration = $directory->getPwdPolicyConfiguration($ldap, $entry["dn"], $ldap_default_ppolicy); - if ($ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_durantion; } - if ($ldap_password_max_age) { $pwdPolicyConfiguration['password_max_age'] = $ldap_password_max_age; } + if (isset($ldap_lockout_duration) and $ldap_lockout_duration) { $pwdPolicyConfiguration['lockout_duration'] = $ldap_lockout_duration; } + if (isset($ldap_password_max_age) and $ldap_password_max_age) { $pwdPolicyConfiguration['password_max_age'] = $ldap_password_max_age; } $isWillExpire = false; $expirationDate = $directory->getPasswordExpirationDate($ldap, $entry["dn"], $pwdPolicyConfiguration); diff --git a/lib/audit.inc.php b/lib/audit.inc.php index 05e4b70..33ef1d7 100644 --- a/lib/audit.inc.php +++ b/lib/audit.inc.php @@ -44,8 +44,8 @@ function displayauditlog($audit_log_file, $audit_log_days, $audit_log_sortby, $a } function dateSort(array &$events, $sortkey, $audit_log_reverse) { - $reverse_order = fn($a, $b) => strtotime($a[$sortkey]) < strtotime($b[$sortkey]); - $normal_order = fn($a, $b) => strtotime($a[$sortkey]) > strtotime($b[$sortkey]); + $reverse_order = fn($a, $b) => strtotime($b[$sortkey]) <=> strtotime($a[$sortkey]); + $normal_order = fn($a, $b) => strtotime($a[$sortkey]) <=> strtotime($b[$sortkey]); if ($audit_log_reverse) { usort($events, $reverse_order); diff --git a/templates/comment.tpl b/templates/comment.tpl index dc8f759..505552c 100644 --- a/templates/comment.tpl +++ b/templates/comment.tpl @@ -1,7 +1,7 @@