From 832b77f94db581d2ad4cde7b525e3ac4620ef9fd Mon Sep 17 00:00:00 2001
From: Janne Koschinski <janne@kuschku.de>
Date: Fri, 16 Sep 2016 02:21:17 +0200
Subject: [PATCH] Fixed another minor bug

---
 login.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/login.php b/login.php
index 1eb6590..9fa8e2a 100644
--- a/login.php
+++ b/login.php
@@ -12,7 +12,7 @@ $config = Config::createFromGlobals();
 $renderer = new RendererHelper($config);
 $backend = Backend::createFromConfig($config);
 
-if ($_SERVER['REQUEST_METHOD'] === 'POST' && $_GET['action'] === 'login') {
+if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_GET['action']) && $_GET['action'] === 'login') {
     $username = $_POST['username'] ?: '';
     $password = $_POST['password'] ?: '';
     if ($backend->authenticate($username, $password)) {
@@ -20,7 +20,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && $_GET['action'] === 'login') {
         $session->password = $password;
         $renderer->redirect('/');
     }
-} elseif ($_GET['action'] === 'logout') {
+} elseif (isset($_GET['action']) && $_GET['action'] === 'logout') {
     $session->destroy();
     $renderer->redirect('/login.php');
 } else if ($backend->authenticate($session->username ?: '', $session->password ?: '')) {
-- 
GitLab