login/visits: indicate admin users
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 14 Jun 2018 09:59:07 +0000 (11:59 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 14 Jun 2018 12:45:19 +0000 (14:45 +0200)
login/visits.php

index 1cecc8af64ccb714990afd0a42e82d2da366ae09..a26f3072382c290d93be6b8aa66eab793d6a609f 100644 (file)
@@ -5,6 +5,7 @@ foreach (glob('profile/*') as $userdir) {
                'login' => basename($userdir),
                'name' => @file_get_contents("$userdir/name.txt"),
                'seen' => @filemtime("$userdir/last.log"),
+               'admin' => @file_exists("$userdir/.admin"),
        ];
 }
 
@@ -14,10 +15,14 @@ if (@$_GET['order'] == 'seen') {
 
 print "<ul>\n";
 foreach ($logins as $profile) {
-       printf('<li>%s <a href="%s">%s</a></li>'."\n",
+       printf('<li>%s <a href="%s">%s</a>',
                $profile['seen'] ? strftime('%F %H:%M', $profile['seen']) : '✘',
                '/login/edit/'.$profile['login'],
                $profile['name'] ?: $profile['login']
        );
+       if (!empty($profile['admin'])) {
+               print ' <em>(beheerder)</em>';
+       }
+       print "</li>\n";
 }
 print "</ul>\n\n";