login: templating support for warning message
[minimedit.git] / login.php
index 1c7dfe0c2c5f6878fe893235887be4848611cdda..bcc2856bbae3c787f8375337dd7ff1dba70d55c4 100644 (file)
--- a/login.php
+++ b/login.php
@@ -18,6 +18,8 @@ elseif (isset($_GET['logout'])) {
 if (empty($User)) {
        ob_clean();
        require_once 'login.inc.php';
+       $part = ['warn' => $message];
+       print getoutput($part);
        return TRUE;
 }
 
@@ -28,13 +30,13 @@ if (isset($_GET['goto'])) {
        http_response_code(302);
        exit;
 }
-?>
-<p>Ingelogd als <em><?php print $User['name']; ?></em>.</p>
 
-<p class="nav"><a href="?logout">Uitloggen</a></p>
+$part = [
+       'user'  => $User['name'],
+];
+print getoutput($part);
 
-<?php
-if (!empty($User['admin'])) {
+if (empty($Args) and !empty($User['admin'])) {
        include_once 'admin/index.html';
        include_once 'admin.php';
 }