Skip to content

Commit 2d4166e

Browse files
committed
add columns to user-mgmt (qualified only)
1 parent aa60063 commit 2d4166e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

webroot/admin/user-mgmt.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ class="filterSearch"
4242
<th id="mail"><span class="filter">⫧ </span>Mail</th>
4343
<th id="groups"><span class="filter">⫧ </span>Groups</th>
4444
<th>Actions</th>
45+
<?php
46+
foreach (UserFlag::cases() as $flag) {
47+
if ($flag != UserFlag::QUALIFIED) {
48+
$value = $flag->value;
49+
echo "<th id='$value'><span class='filter'>⫧ </span>$value</th>";
50+
}
51+
}
52+
?>
4553
</tr>
4654

4755
<?php
@@ -54,6 +62,12 @@ class="filterSearch"
5462
"mail" => ["(not found)"]
5563
]
5664
);
65+
$users_with_flags = [];
66+
foreach (UserFlag::cases() as $flag) {
67+
if ($flag != UserFlag::QUALIFIED) {
68+
$users_with_flags[$flag->value] = $LDAP->userFlagGroups[$flag->value]->getMemberUIDs();
69+
}
70+
}
5771
usort($user_attributes, fn ($a, $b) => strcmp($a["uid"][0], $b["uid"][0]));
5872
foreach ($user_attributes as $attributes) {
5973
$uid = $attributes["uid"][0];
@@ -89,6 +103,15 @@ class="filterSearch"
89103
<input type='submit' name='action' value='Access'>
90104
</form>";
91105
echo "</td>";
106+
foreach (UserFlag::cases() as $flag) {
107+
echo "<td>";
108+
if ($flag != UserFlag::QUALIFIED) {
109+
if (in_array($uid, $users_with_flags[$flag->value])) {
110+
echo $flag->value;
111+
}
112+
}
113+
echo "</td>";
114+
}
92115
echo "</tr>";
93116
}
94117
?>

0 commit comments

Comments
 (0)