Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-02-17 02:21:41 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-02-17 02:21:41 +0400
commitbf21210326aab3316b6e5cba8d9f2fb22042cf94 (patch)
treec1983081a208da15ea3a57c388275a61c1237e6f /plugins/SegmentEditor
parent1238ea35c8329c90180431f6f387f77e04d003f1 (diff)
refs #4679 do not add any segments in case user does not have super user access
Diffstat (limited to 'plugins/SegmentEditor')
-rw-r--r--plugins/SegmentEditor/SegmentEditor.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/SegmentEditor/SegmentEditor.php b/plugins/SegmentEditor/SegmentEditor.php
index 89c8ddc6de..2441e4d559 100644
--- a/plugins/SegmentEditor/SegmentEditor.php
+++ b/plugins/SegmentEditor/SegmentEditor.php
@@ -12,6 +12,7 @@ use Exception;
use Piwik\Common;
use Piwik\Db;
use Piwik\DbHelper;
+use Piwik\Piwik;
use Piwik\Version;
/**
@@ -54,6 +55,10 @@ class SegmentEditor extends \Piwik\Plugin
public function getKnownSegmentsToArchiveAllSites(&$segments)
{
+ if (!Piwik::hasUserSuperUserAccess()) {
+ return;
+ }
+
$model = new Model();
$segmentsToAutoArchive = $model->getSegmentsToAutoArchive($idSite = false);
@@ -64,6 +69,10 @@ class SegmentEditor extends \Piwik\Plugin
public function getKnownSegmentsToArchiveForSite(&$segments, $idSite)
{
+ if (!Piwik::hasUserSuperUserAccess()) {
+ return;
+ }
+
$model = new Model();
$segmentToAutoArchive = $model->getSegmentsToAutoArchive($idSite);