2013-06-14 07:51:44 -04:00
|
|
|
<?php
|
2016-02-08 09:41:00 -05:00
|
|
|
/* Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */
|
2013-06-14 07:51:44 -04:00
|
|
|
|
2015-08-27 07:31:36 -04:00
|
|
|
namespace Icinga\Controllers;
|
2013-06-14 07:51:44 -04:00
|
|
|
|
2014-01-24 06:20:13 -05:00
|
|
|
use Icinga\Web\Controller\ActionController;
|
2014-03-04 08:24:53 -05:00
|
|
|
use Icinga\Web\Url;
|
2013-06-14 07:51:44 -04:00
|
|
|
|
|
|
|
|
/**
|
2013-08-16 08:56:23 -04:00
|
|
|
* Application wide index controller
|
2013-06-14 07:51:44 -04:00
|
|
|
*/
|
|
|
|
|
class IndexController extends ActionController
|
|
|
|
|
{
|
|
|
|
|
/**
|
2013-08-30 09:50:49 -04:00
|
|
|
* Use a default redirection rule to welcome page
|
2013-06-14 07:51:44 -04:00
|
|
|
*/
|
|
|
|
|
public function preDispatch()
|
|
|
|
|
{
|
2013-08-30 09:50:49 -04:00
|
|
|
if ($this->getRequest()->getActionName() !== 'welcome') {
|
2022-10-04 04:53:46 -04:00
|
|
|
$landingPage = getenv('ICINGAWEB_LANDING_PAGE');
|
|
|
|
|
if (! $landingPage) {
|
|
|
|
|
$landingPage = 'dashboard';
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-12 06:28:40 -05:00
|
|
|
// @TODO(el): Avoid landing page redirects: https://dev.icinga.com/issues/9656
|
2022-10-04 04:53:46 -04:00
|
|
|
$this->redirectNow(Url::fromRequest()->setPath($landingPage));
|
2013-06-14 07:51:44 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2013-08-16 08:56:23 -04:00
|
|
|
* Application's start page
|
2013-06-14 07:51:44 -04:00
|
|
|
*/
|
|
|
|
|
public function welcomeAction()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|