From 95189fbf46e4f88ce7146457a12ba0745155c62f Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 6 Mar 2014 11:07:24 +0000 Subject: [PATCH] Fix layout re-rendering after login (thank you, automerge) --- application/controllers/AuthenticationController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/controllers/AuthenticationController.php b/application/controllers/AuthenticationController.php index 57ba5be4d..da687e36c 100644 --- a/application/controllers/AuthenticationController.php +++ b/application/controllers/AuthenticationController.php @@ -39,6 +39,7 @@ use Icinga\Logger\Logger; use Icinga\Exception\NotReadableError; use Icinga\Exception\ConfigurationError; use Icinga\User; +use Icinga\Web\Url; /** * Application wide controller for authentication @@ -61,7 +62,10 @@ class AuthenticationController extends ActionController $this->view->form->setRequest($this->_request); $this->view->title = 'Icinga Web Login'; try { - $redirectUrl = $this->_request->getParam('redirect', 'index?_render=body'); + $redirectUrl = Url::fromPath($this->_request->getParam('redirect', 'dashboard')); + if ($this->_request->isXmlHttpRequest()) { + $redirectUrl->setParam('_render', 'layout'); + } $auth = AuthManager::getInstance(); if ($auth->isAuthenticated()) { $this->redirectNow($redirectUrl);