4 if (isset($_POST['login'])) {
5 if ($User = login($_POST['login'], $_POST['pass'])) {
9 $message = 'Ongeldige gebruikersnaam of wachtwoord.';
12 elseif (isset($_GET['logout'])) {
13 setcookie('login', '', time(), '/'); # expire immediately
15 $message = "Je bent uitgelogd. Graag tot ziens!";
20 require_once 'login.inc.php';
21 $part = ['warn' => $message];
22 print getoutput($part);
26 if (isset($_GET['goto'])) {
28 $target = ltrim($_GET['goto'], '/');
29 header("Location: /$target");
30 http_response_code(302);
35 'user' => $User['name'],
37 print getoutput($part);
39 if (empty($Args) and !empty($User['admin'])) {
40 include_once 'admin/index.html';
41 include_once 'admin.php';