diff options
author | mattab <matthieu.aubry@gmail.com> | 2015-02-20 02:18:31 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2015-02-20 02:18:31 +0300 |
commit | 41544b46892074d77ad4a9bd806ffa18db4c59a3 (patch) | |
tree | f2e9fbc96fbf1e16c9387a2f9fe4c927debf50c2 /core | |
parent | 3250f48aa9d9d27d6a35ee8a7df2fce306c81ee6 (diff) |
refs #7104 Rename vars and put logic into method
Diffstat (limited to 'core')
-rw-r--r-- | core/FrontController.php | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/core/FrontController.php b/core/FrontController.php index a077820e5c..bd473bba8f 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -467,19 +467,7 @@ class FrontController extends Singleton ) { Session::start(); - $isDashboardReferer = !empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'module=CoreHome&action=index') !== false; - $isAllWebsitesReferer = !empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'module=MultiSites&action=index') !== false; - - if ($isDashboardReferer - && !empty($_POST['token_auth']) - && Common::getRequestVar('widget', 0, 'int') === 1) { - Session::close(); - } - - if (($isDashboardReferer || $isAllWebsitesReferer) - && Common::getRequestVar('viewDataTable', '', 'string') === 'sparkline') { - Session::close(); - } + $this->closeSessionEarlyForFasterUI(); } if (is_null($parameters)) { @@ -549,6 +537,25 @@ class FrontController extends Singleton Url::redirectToHttps(); } + private function closeSessionEarlyForFasterUI() + { + $isDashboardReferrer = !empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'module=CoreHome&action=index') !== false; + $isAllWebsitesReferrer = !empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'module=MultiSites&action=index') !== false; + + if ($isDashboardReferrer + && !empty($_POST['token_auth']) + && Common::getRequestVar('widget', 0, 'int') === 1 + ) { + Session::close(); + } + + if (($isDashboardReferrer || $isAllWebsitesReferrer) + && Common::getRequestVar('viewDataTable', '', 'string') === 'sparkline' + ) { + Session::close(); + } + } + private function handleProfiler() { if (!empty($_GET['xhprof'])) { @@ -622,4 +629,5 @@ class FrontController extends Singleton Piwik::postEvent('Request.dispatch.end', array(&$result, $module, $action, $parameters)); return $result; } + } |