AuthenticationController: Add cookie detection to login action

refs #7383
This commit is contained in:
Alexander Fuhr 2015-08-13 11:21:05 +02:00
parent 813154f6ef
commit d468c59e32
1 changed files with 6 additions and 0 deletions

View File

@ -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;