login/edit: admin event dates (creation, setup, visit)
[minimedit.git] / widget / login / edit.php
index 0d61a4f2a029e2ffa2a3758da6e09c8f47ee1fe9..bb0f75ca28f0947db9b076b0ef4dc4e884394ab1 100644 (file)
@@ -8,7 +8,7 @@ if ($User->admin('user')
 and !empty($Place['user']) and $Place['user'] !== $User->login) {
        $username = strtolower($Place['user']);
        unset($user);
-       $user = new User("profile/$username");
+       $user = new User("profile/$username", FALSE);
 }
 
 require_once('edit.inc.php');
@@ -161,7 +161,42 @@ if ($_POST) {
        }
 }
 
+if ($User->admin('user')) {
 ?>
+<aside>
+<h2>Gebruikersbeheer</h2>
+<dl>
+<?php if ($time = @fileatime($user->dir)) { // assume noatime ?>
+<dt>Aangemaakt</dt>
+<dd><?php print strftime('%F %H:%M', $time); ?></dd>
+<?php } ?>
+<?php if ($time = @filemtime("{$user->dir}/.passwd")) { ?>
+<dt>Wachtwoord ingesteld</dt>
+<dd><?php print strftime('%F %H:%M', $time); ?></dd>
+<?php } ?>
+<?php if ($user->seen) { ?>
+<dt>Laatste bezoek</dt>
+<dd><?php print strftime('%F %H:%M', $user->seen); ?></dd>
+<?php } ?>
+</dl>
+<?php
+       $postdir = 'doc/post';
+       if (is_dir($postdir)) {
+               print "<h3>Brieven</h3><ul>\n";
+               foreach (glob("$postdir/*.html") as $link) {
+                       $page = new ArchiveArticle($link);
+                       printf('<li><a href="/%s?login=%s">%s</a></li>'."\n",
+                               $page->link, $user->login, $page->name
+                       );
+               }
+               print "</ul>\n";
+       }
+?>
+</aside>
+<?php
+}
+?>
+
 <form method="post" enctype="multipart/form-data">
        <ul class="grid">
 <?php
@@ -173,7 +208,7 @@ foreach ($cols as $col => &$colconf) {
        print "\t";
        printf('<li><label for="%s">%s:</label>', $col, ucfirst($colconf['label']));
        if (@$colconf['type'] == 'file' and isset($colconf['value'])) {
-               $target = $user['dir'] . '/' . $colconf['filename'];
+               $target = $user->dir . '/' . $colconf['filename'];
                printf('<a href="/%s"><img src="/thumb/%s/%s?%s" /></a><br />',
                        $target,
                        200, $target, filemtime($target)