From f1fc0c1fba82f82d805e84397864248819329d9c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 17 Oct 2017 17:22:22 +0200 Subject: [PATCH] added expired to status selction --- lam/lib/types/user.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lam/lib/types/user.inc b/lam/lib/types/user.inc index 792eed2a..02b04cba 100644 --- a/lam/lib/types/user.inc +++ b/lam/lib/types/user.inc @@ -624,6 +624,8 @@ class lamUserList extends lamList { /** virtual attribute name for account status column */ const ATTR_ACCOUNT_STATUS = 'lam_virtual_account_status'; + /** filter value for expired accounts */ + const FILTER_EXPIRED = 1; /** filter value for locked accounts */ const FILTER_LOCKED = 2; /** filter value for partially locked accounts */ @@ -872,7 +874,8 @@ class lamUserList extends lamList { '' => '', _('Unlocked') => self::FILTER_UNLOCKED, _('Partially locked') => self::FILTER_SEMILOCKED, - _('Locked') => self::FILTER_LOCKED + _('Locked') => self::FILTER_LOCKED, + _('Expired') => self::FILTER_EXPIRED, ); $filterInput = new htmlSelect('filter' . strtolower($attrName), $filterOptions, array($value)); $filterInput->setCSSClasses(array($this->type->getScope() . '-dark')); @@ -950,8 +953,13 @@ class lamUserList extends lamList { || ($sambaAvailable && !$sambaLocked) || ($ppolicyAvailable && !$ppolicyLocked) || ($windowsAvailable && !$windowsLocked); + $shadowExpired = shadowAccount::isAccountExpired($this->entries[$i]); + $expired = $shadowExpired; $status = self::FILTER_UNLOCKED; - if ($hasLocked && $hasUnlocked) { + if ($expired) { + $status = self::FILTER_EXPIRED; + } + elseif ($hasLocked && $hasUnlocked) { $status = self::FILTER_SEMILOCKED; } elseif (!$hasUnlocked && $hasLocked) {