diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2017-05-13 02:12:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-13 02:12:14 +0300 |
commit | ca35a8a0814c24263094e116b95df650b70d09bb (patch) | |
tree | 869e1acb94c170cc6104e02bca18ab3b093b1158 /plugins/SitesManager/Controller.php | |
parent | 716752b01040da6fc3b2a9e396d8e5cee7e5663a (diff) |
Add possibility to ignore "no data recorded" screen for one hour (#11686)
* Add possibility to ignore "no data recorded" screen for one hour
* update screens
* update wording
Diffstat (limited to 'plugins/SitesManager/Controller.php')
-rw-r--r-- | plugins/SitesManager/Controller.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/SitesManager/Controller.php b/plugins/SitesManager/Controller.php index b488c39d89..91744e84b2 100644 --- a/plugins/SitesManager/Controller.php +++ b/plugins/SitesManager/Controller.php @@ -13,6 +13,7 @@ use Piwik\API\ResponseBuilder; use Piwik\Common; use Piwik\Exception\UnexpectedWebsiteFoundException; use Piwik\Piwik; +use Piwik\Session; use Piwik\Settings\Measurable\MeasurableSettings; use Piwik\SettingsPiwik; use Piwik\Site; @@ -130,6 +131,18 @@ class Controller extends \Piwik\Plugin\ControllerAdmin return file_get_contents($path . $filename); } + public function ignoreNoDataMessage() + { + Piwik::checkUserHasSomeViewAccess(); + + $session = new Session\SessionNamespace('siteWithoutData'); + $session->ignoreMessage = true; + $session->setExpirationSeconds($oneHour = 60 * 60); + + $url = Url::getCurrentUrlWithoutQueryString() . Url::getCurrentQueryStringWithParametersModified(array('module' => 'CoreHome', 'action' => 'index')); + Url::redirectToUrl($url); + } + public function siteWithoutData() { $javascriptGenerator = new TrackerCodeGenerator(); |