X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/42039af9beb75f90f22fad213eafb0b5c39c71aa..4c23deb380856076ebe30ab8f5f2e8916c9f7096:/login/list.php diff --git a/login/list.php b/login/list.php index 2cf27d1..7872bd6 100644 --- a/login/list.php +++ b/login/list.php @@ -8,11 +8,19 @@ foreach ($users as $col => $userdir) { $users[$col] = new User($userdir); } -if (@$Place['order'] == 'seen') { - $order = array_map(function ($col) { return $col->seen; }, $users); -# $order = array_column($users, 'seen'); #TODO php7 simplification - array_multisort($order, SORT_DESC, SORT_NUMERIC, $users); - $users = array_intersect_key($users, array_filter($order)); +if (isset($Place['order'])) { + $ordercol = $Place['order']; + $order = array_map(function ($row) use ($ordercol) { + return $row->$ordercol; + }, $users); +# $order = array_column($users, $ordercol); #TODO php7 simplification + if ($ordercol == 'seen') { + array_multisort($order, SORT_DESC, SORT_NUMERIC, $users); + $users = array_intersect_key($users, array_filter($order)); + } + else { + array_multisort($order, SORT_ASC, SORT_NATURAL, $users); + } } if (isset($Place['n'])) { @@ -59,6 +67,7 @@ foreach ($users as $user) { if ($user->admin) { $name .= ' 🔧'; } + $name = "
$name
"; } print "
  • $name
  • \n";