diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-01-07 15:40:25 +0100 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-01-07 15:40:25 +0100 |
| commit | cf83d7b7c2a6019c082ab555ff956612b01d3286 (patch) | |
| tree | d82cad50fa2f6138bab665ab25132ab33cb5a545 | |
| parent | 44c7ca5c86042f91b79b02707f2fd99d54d5a3ae (diff) | |
add legend, invert icons and let search by locked also find expired accounts
| -rw-r--r-- | app/views/admin/user/_results.php | 11 | ||||
| -rw-r--r-- | app/views/admin/user/index.php | 6 | ||||
| -rw-r--r-- | lib/models/User.php | 3 |
3 files changed, 12 insertions, 8 deletions
diff --git a/app/views/admin/user/_results.php b/app/views/admin/user/_results.php index 7f57fe3..e076ccb 100644 --- a/app/views/admin/user/_results.php +++ b/app/views/admin/user/_results.php @@ -63,13 +63,13 @@ <?= htmlReady($user->username) ?> </a> <? if ($user->locked) : ?> - <?= Icon::create('lock-locked', Icon::ROLE_INFO)->asSvg(tooltip2(sprintf(_('%s ist gesperrt'), htmlReady($user->getFullName())))) ?> + <?= Icon::create('lock-locked2', Icon::ROLE_INFO)->asSvg(tooltip2(sprintf(_('%s ist gesperrt'), htmlReady($user->getFullName())))) ?> <? elseif ($user->isExpired()): ?> - <?= Icon::create('lock-locked2', Icon::ROLE_INFO)->asSvg(tooltip2(sprintf(_('%s ist abgelaufen'), htmlReady($user->getFullName())))) ?> + <?= Icon::create('lock-locked', Icon::ROLE_INFO)->asSvg(tooltip2(sprintf(_('%s ist abgelaufen'), htmlReady($user->getFullName())))) ?> <? endif ?> </td> <td> - <? + <? $userdomains = UserDomain::getUserDomainsForUser($user->user_id); $tooltxt = _('Sichtbarkeit:') . ' ' . $user->visible; if (!empty($userdomains)) { @@ -81,10 +81,7 @@ }); $tooltxt .= "\n" . _('Domänen:') . ' ' . implode(', ', $domains); } - if ($user->locked == '1') { - $tooltxt .= "\n" . _("Nutzer ist gesperrt!"); - } - ?> + ?> <?= tooltipHtmlIcon(htmlReady($tooltxt, true, true)) ?> </td> <td><?= htmlReady($user->matriculation_number) ?></td> diff --git a/app/views/admin/user/index.php b/app/views/admin/user/index.php index 13c9b39..56959aa 100644 --- a/app/views/admin/user/index.php +++ b/app/views/admin/user/index.php @@ -79,6 +79,12 @@ use Studip\Button; <label class="col-2" style="padding-top: 1.8em;"> <input type="checkbox" name="locked" value="1" <?= !empty($request['locked']) ? 'checked' : '' ?>> <?= _('nur gesperrt') ?> + <?= tooltipHtmlIcon(implode('<br>', [ + '<strong>' . _('Legende') . '</strong>', + '', + Icon::create('lock-locked2', Icon::ROLE_INFO)->asSvg(['class' => 'text-bottom']) . ' ' . _('Gesperrtes Konto'), + Icon::create('lock-locked', Icon::ROLE_INFO)->asSvg(['class' => 'text-bottom']) . ' ' . _('Abgelaufenes Konto'), + ])) ?> </label> </fieldset> diff --git a/lib/models/User.php b/lib/models/User.php index df87c3c..f708524 100644 --- a/lib/models/User.php +++ b/lib/models/User.php @@ -479,7 +479,8 @@ class User extends AuthUserMd5 implements Range, PrivacyObject, Studip\Calendar\ //locked user if (!empty($attributes['locked'])) { - $where[] = "au.`locked` = 1"; + $joins[] = "LEFT JOIN `config_values` cvl ON (cvl.`range_id` = au.`user_id` AND cvl.`field` = 'EXPIRATION_DATE')"; + $where[] = "(au.`locked` = 1 OR (cvl.`value` IS NOT NULL AND cvl.`value` < UNIX_TIMESTAMP()))"; } // show only users who are not lecturers |
