X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/d254e367684dcbde047f8f76fd9df3dd9ed3cf34..v3.9-11-g234326791b:/login/list.php?ds=inline diff --git a/login/list.php b/login/list.php index cae89f0..698b805 100644 --- a/login/list.php +++ b/login/list.php @@ -8,15 +8,37 @@ foreach ($users as $col => $userdir) { $users[$col] = new User($userdir); } +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'])) { + array_splice($users, $Place['n']); # limit number of results +} + print '