|
115 | 115 | <?php |
116 | 116 | $accounts = $LDAP->getAllPIGroups($SQL, $MAILER); |
117 | 117 |
|
118 | | -foreach ($accounts as $pi_group) { |
119 | | - $pi_user = $pi_group->getOwner(); |
120 | | - |
121 | | - echo "<tr class='expandable'>"; |
122 | | - echo "<td><button class='btnExpand'>▶</button>" . $pi_user->getFirstname() . |
123 | | - " " . $pi_user->getLastname() . "</td>"; |
124 | | - echo "<td>" . $pi_group->getPIUID() . "</td>"; |
125 | | - echo "<td><a href='mailto:" . $pi_user->getMail() . "'>" . $pi_user->getMail() . "</a></td>"; |
126 | | - echo "<td>"; |
127 | | - echo |
128 | | - "<form action='' method='POST' |
| 118 | + usort($accounts, function ($a, $b) { |
| 119 | + return strcmp($a->getPIUID(), $b->getPIUID()); |
| 120 | + }); |
| 121 | + |
| 122 | + foreach ($accounts as $pi_group) { |
| 123 | + $pi_user = $pi_group->getOwner(); |
| 124 | + |
| 125 | + echo "<tr class='expandable'>"; |
| 126 | + echo "<td><button class='btnExpand'>▶</button>" . $pi_user->getFirstname() . |
| 127 | + " " . $pi_user->getLastname() . "</td>"; |
| 128 | + echo "<td>" . $pi_group->getPIUID() . "</td>"; |
| 129 | + echo "<td><a href='mailto:" . $pi_user->getMail() . "'>" . $pi_user->getMail() . "</a></td>"; |
| 130 | + echo "<td>"; |
| 131 | + echo |
| 132 | + "<form action='' method='POST' |
129 | 133 | onsubmit='return confirm(\"Are you sure you want to remove " . $pi_group->getPIUID() . "?\")'> |
130 | 134 | <input type='hidden' name='form_name' value='remGroup'> |
131 | 135 | <input type='hidden' name='pi' value='" . $pi_group->getPIUID() . "'> |
132 | 136 | <input type='submit' value='Remove'> |
133 | 137 | </form>"; |
134 | | - echo "</td>"; |
135 | | - echo "</tr>"; |
136 | | -} |
137 | | -?> |
| 138 | + echo "</td>"; |
| 139 | + echo "</tr>"; |
| 140 | + } |
| 141 | + ?> |
138 | 142 | </table> |
139 | 143 |
|
140 | 144 | <script> |
|
0 commit comments