diff options
author | Matthieu Aubry <matt@piwik.org> | 2015-03-12 00:26:42 +0300 |
---|---|---|
committer | Matthieu Aubry <matt@piwik.org> | 2015-03-12 00:26:42 +0300 |
commit | cdb6840bb254de2a1d770cde698079c1c9970322 (patch) | |
tree | 3f1f66638022942545cdec7df725de2ba4ba7016 /plugins/CoreAdminHome/Controller.php | |
parent | 9ff8200966b3b10a457f17b0ce926aa6c0b23954 (diff) | |
parent | e7e829dfaad4c87b5f45f320ebfdb967c888c122 (diff) |
Merge pull request #7352 from ArnY/dntOptOut
Take DNT into account cf piwik/piwik#7317
Diffstat (limited to 'plugins/CoreAdminHome/Controller.php')
-rw-r--r-- | plugins/CoreAdminHome/Controller.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/CoreAdminHome/Controller.php b/plugins/CoreAdminHome/Controller.php index 732639874a..eacbb60406 100644 --- a/plugins/CoreAdminHome/Controller.php +++ b/plugins/CoreAdminHome/Controller.php @@ -321,7 +321,10 @@ class Controller extends ControllerAdmin public function optOut() { $trackVisits = !IgnoreCookie::isIgnoreCookieFound(); - + + $dntChecker = new DoNotTrackHeaderChecker(); + $dntFound = $dntChecker->isDoNotTrackFound(); + $nonce = Common::getRequestVar('nonce', false); $language = Common::getRequestVar('language', ''); if ($nonce !== false && Nonce::verifyNonce('Piwik_OptOut', $nonce)) { @@ -330,6 +333,8 @@ class Controller extends ControllerAdmin $trackVisits = !$trackVisits; } + + $lang = APILanguagesManager::getInstance()->isLanguageAvailable($language) ? $language : LanguagesManager::getLanguageCodeForCurrentUser(); @@ -339,6 +344,7 @@ class Controller extends ControllerAdmin // parameter is required) $view = new View("@CoreAdminHome/optOut"); $view->setXFrameOptions('allow'); + $view->dntFound = $dntFound; $view->trackVisits = $trackVisits; $view->nonce = Nonce::getNonce('Piwik_OptOut', 3600); $view->language = $lang; |