From 01f210ad435698f485a44f920db09d3e1f23c6dc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 30 Jul 2025 14:27:12 +0200 Subject: [PATCH] check if user has a pwd expiration before outputing it --- views/bootstrap/class.UserList.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/views/bootstrap/class.UserList.php b/views/bootstrap/class.UserList.php index ad9e1491f..96b93b881 100644 --- a/views/bootstrap/class.UserList.php +++ b/views/bootstrap/class.UserList.php @@ -112,13 +112,18 @@ class SeedDMS_View_UserList extends SeedDMS_Theme_Style { echo ""; if($pwdexpiration) { $now = new DateTime(); - $expdate = new DateTime($currUser->getPwdExpiration()); - $diff = $now->diff($expdate); - if($expdate > $now) { - printf(getMLText('password_expires_in_days'), $diff->format('%a')); - echo " (".$expdate->format('Y-m-d H:i:sP').")"; + $tmp = $currUser->getPwdExpiration(); + if($tmp) { + $expdate = new DateTime($tmp); + $diff = $now->diff($expdate); + if($expdate > $now) { + printf(getMLText('password_expires_in_days'), $diff->format('%a')); + echo " (".$expdate->format('Y-m-d H:i:sP').")"; + } else { + printMLText("password_expired"); + } } else { - printMLText("password_expired"); + printMLText("password_never_expires"); } } $sessions = $sessionmgr->getUserSessions($currUser, 10);