'login' => basename($userdir),
'name' => @file_get_contents("$userdir/name.txt"),
'seen' => @filemtime("$userdir/last.log"),
+ 'admin' => @file_exists("$userdir/.admin"),
];
}
array_multisort(array_column($logins, 'seen'), SORT_DESC, SORT_NUMERIC, $logins);
}
-print "<ul>\n";
+print "<ul class=cols>\n";
foreach ($logins as $profile) {
- printf('<li>%s <a href="/login/%s">%s</a></li>'."\n",
- $profile['seen'] ? strftime('%F %H:%M', $profile['seen']) : '✘',
- $profile['login'],
+ printf('<li><a href="%s">%s</a>',
+ '/login/edit/'.$profile['login'],
$profile['name'] ?: $profile['login']
);
+ if ($profile['seen']) {
+ printf(' <small class="date">%s</small>', strftime('%F %H:%M', $profile['seen']));
+ }
+ if (!empty($profile['admin'])) {
+ print ' <em>(beheerder)</em>';
+ }
+ print "</li>\n";
}
print "</ul>\n\n";