improve password expiration

This commit is contained in:
Uwe Steinmann 2023-03-29 20:57:48 +02:00
parent 382e78855d
commit 476c726a45

View File

@ -103,14 +103,14 @@ if(file_exists($settings->_rootDir . "view/".$theme."/languages/" . $lang . "/la
/* Check if password needs to be changed because it expired. If it needs
* to be changed redirect to out/out.ForcePasswordChange.php. Do this
* check only if password expiration is turned on, we are not on the
* page to change the password or the page that changes the password,
* it is not admin, and there is currently no user substitution */
* page to change the password or the page that changes the password, the
* current user is not admin, and no user substitution has occured. */
if (!$user->isAdmin()) {
if(!$resArr['su'] && $settings->_passwordExpiration > 0) {
if (!$user->isAdmin() && !$resArr['su']) {
if($settings->_passwordExpiration > 0) {
if(basename($_SERVER['SCRIPT_NAME']) != 'out.ForcePasswordChange.php' && basename($_SERVER['SCRIPT_NAME']) != 'op.EditUserData.php' && basename($_SERVER['SCRIPT_NAME']) != 'op.Logout.php') {
$pwdexp = $user->getPwdExpiration();
if(substr($pwdexp, 0, 10) != '0000-00-00') {
if($pwdexp && substr($pwdexp, 0, 10) != '0000-00-00') {
$pwdexpts = strtotime($pwdexp); // + $pwdexp*86400;
if($pwdexpts > 0 && $pwdexpts < time()) {
header("Location: ../out/out.ForcePasswordChange.php");