2828
2929<!-- <input type="text" id="tableSearch" placeholder="Search..."> -->
3030
31- <table class="searchable longTable sortable filterable">
31+ <table class="searchable longTable sortable filterable column-toggle" id="user-table ">
3232 <tr>
3333 <input
3434 type="text"
@@ -39,10 +39,16 @@ class="filterSearch"
3939 >
4040 <th id="name"><span class="filter">⫧ </span>Name</th>
4141 <th id="uid"><span class="filter">⫧ </span>UID</th>
42- <th id="org"><span class="filter">⫧ </span>Org</th>
42+ <th id="org" class="hidden-by-default" ><span class="filter">⫧ </span>Org</th>
4343 <th id="mail"><span class="filter">⫧ </span>Mail</th>
4444 <th id="groups"><span class="filter">⫧ </span>Groups</th>
4545 <th>Actions</th>
46+ <?php
47+ foreach (UserFlag::cases () as $ flag ) {
48+ $ val = $ flag ->value ;
49+ echo "<th id=' $ val' class='hidden-by-default'><span class='filter'>⫧ </span> $ val</th> " ;
50+ }
51+ ?>
4652 </tr>
4753
4854 <?php
@@ -56,6 +62,10 @@ class="filterSearch"
5662 ]
5763 );
5864 $ csrf_token = htmlspecialchars (CSRFToken::generate ());
65+ $ users_with_flags = [];
66+ foreach (UserFlag::cases () as $ flag ) {
67+ $ users_with_flags [$ flag ->value ] = $ LDAP ->userFlagGroups [$ flag ->value ]->getMemberUIDs ();
68+ }
5969 usort ($ user_attributes , fn ($ a , $ b ) => strcmp ($ a ["uid " ][0 ], $ b ["uid " ][0 ]));
6070 foreach ($ user_attributes as $ attributes ) {
6171 $ uid = $ attributes ["uid " ][0 ];
@@ -73,8 +83,8 @@ class="filterSearch"
7383 </td>
7484 " ;
7585 echo "<td> " ;
76- if (count ($ UID2PIGIDs [$ uid ] ?? []) > 0 ) {
77- echo "<table style='margin: 0 0 0 0;' > " ;
86+ if (array_key_exists ( $ uid , $ UID2PIGIDs ) && count ($ UID2PIGIDs [$ uid ] ?? []) > 0 ) {
87+ echo "<table> " ;
7888 foreach ($ UID2PIGIDs [$ uid ] as $ gid ) {
7989 echo "<tr><td> $ gid</td></tr> " ;
8090 }
@@ -90,6 +100,13 @@ class="filterSearch"
90100 <input type='submit' name='action' value='Access'>
91101 </form> " ;
92102 echo "</td> " ;
103+ foreach (UserFlag::cases () as $ flag ) {
104+ echo "<td> " ;
105+ if (in_array ($ uid , $ users_with_flags [$ flag ->value ])) {
106+ echo $ flag ->value ;
107+ }
108+ echo "</td> " ;
109+ }
93110 echo "</tr> " ;
94111 }
95112 ?>
0 commit comments