From 8a890a4a829a91c6bd98d10ba989d0bc7f3cae17 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 19 May 2017 08:39:11 +0200 Subject: [PATCH] ActionController: Allow controllers to customize the login route --- library/Icinga/Web/Controller/ActionController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index 797ace2e4..f0e53523f 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -41,6 +41,11 @@ use Icinga\Web\Window; */ class ActionController extends Zend_Controller_Action { + /** + * The login route to use when requiring authentication + */ + const LOGIN_ROUTE = 'authentication/login'; + /** * Whether the controller requires the user to be authenticated * @@ -370,7 +375,7 @@ class ActionController extends Zend_Controller_Action */ protected function redirectToLogin($redirect = null) { - $login = Url::fromPath('authentication/login'); + $login = Url::fromPath(static::LOGIN_ROUTE); if ($this->isXhr()) { if ($redirect !== null) { $login->setParam('redirect', '__SELF__');