diff options
author | Stefan Giehl <stefan@piwik.org> | 2018-10-03 22:52:29 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2018-10-03 22:52:29 +0300 |
commit | 902bd940c87fd9f0d1730dc2b9560b862b8c8e9a (patch) | |
tree | ea03fcb6f0a79f8e6f06b2814651d55b91f306ea /plugins/SitesManager/Controller.php | |
parent | 67eaa2c0381933d5e38180a2159044893447acca (diff) |
Improve usage of requested site in plugin Controllers (#13526)
Diffstat (limited to 'plugins/SitesManager/Controller.php')
-rw-r--r-- | plugins/SitesManager/Controller.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/SitesManager/Controller.php b/plugins/SitesManager/Controller.php index 2bf49e6f5c..67c08f6ac1 100644 --- a/plugins/SitesManager/Controller.php +++ b/plugins/SitesManager/Controller.php @@ -106,14 +106,14 @@ class Controller extends \Piwik\Plugin\ControllerAdmin */ function displayJavascriptCode() { - $idSite = Common::getRequestVar('idSite'); - Piwik::checkUserHasViewAccess($idSite); + $this->checkSitePermission(); + Piwik::checkUserHasViewAccess($this->idSite); $javascriptGenerator = new TrackerCodeGenerator(); - $jsTag = $javascriptGenerator->generate($idSite, SettingsPiwik::getPiwikUrl()); - $site = new Site($idSite); + $jsTag = $javascriptGenerator->generate($this->idSite, SettingsPiwik::getPiwikUrl()); + $site = new Site($this->idSite); return $this->renderTemplate('displayJavascriptCode', array( - 'idSite' => $idSite, + 'idSite' => $this->idSite, 'displaySiteName' => $site->getName(), 'jsTag' => $jsTag )); @@ -157,7 +157,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin return $this->renderTemplate('siteWithoutData', array( 'siteName' => $this->site->getName(), - 'idSite' => $this->site->getId(), + 'idSite' => $this->idSite, 'trackingHelp' => $this->renderTemplate('_displayJavascriptCode', array( 'displaySiteName' => Common::unsanitizeInputValue($this->site->getName()), 'jsTag' => $javascriptGenerator->generate($this->idSite, $piwikUrl), |