From d468c59e32af20c00ef55b2e7fc52f06b9abd2a8 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Thu, 13 Aug 2015 11:21:05 +0200 Subject: [PATCH] AuthenticationController: Add cookie detection to login action refs #7383 --- application/controllers/AuthenticationController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/controllers/AuthenticationController.php b/application/controllers/AuthenticationController.php index 9431b7fbc..f19b53fc5 100644 --- a/application/controllers/AuthenticationController.php +++ b/application/controllers/AuthenticationController.php @@ -8,6 +8,7 @@ use Icinga\Application\Icinga; use Icinga\Application\Logger; use Icinga\Forms\Authentication\LoginForm; use Icinga\Web\Controller; +use Icinga\Web\Cookie; use Icinga\Web\Url; /** @@ -36,6 +37,11 @@ class AuthenticationController extends Controller $this->redirectNow($form->getRedirectUrl()); } if (! $requiresSetup) { + if (! $this->getRequest()->hasCookieSupport()) { + echo $this->translate("Cookies must be enabled to run this application.\n"); + $this->getResponse()->setHttpResponseCode(403)->sendHeaders(); + exit(); + } $form->handleRequest(); } $this->view->form = $form;