To prevent abuse, autoArchive=1 requires Super User or ControllerAdmin access

(Wesley Richards) #1

Hi there,

we’ve got Piwik 2.3.0 for our university in use and the various departments have their own Piwik ID. Overall, we have about 100 000 pageviews per day. Archiving of data is done via the cron job runs once per hour.
In the individual departments, there are users with normal privileges to view the statistics. These have so far also create segments. But which were generated at runtime what the performance is heavily loaded.
I have now set in the config “enable_create_realtime_segments = 0”.
Now normal user can’t create any segments anymore. That is very unfortunate.
Why do I need Admin rights to create segments that are archived by the cronjob?

Is it a problem if I change the code in "plugins/SegmentEditor/api.php in something like this?

protected function checkAutoArchive($autoArchive, $idSite)
$autoArchive = (int)$autoArchive;
if ($autoArchive) {
$exception = new Exception(“To prevent abuse, autoArchive=1 requires Super User or ControllerAdmin access.”);
if (empty($idSite)) {
if (!Piwik::hasUserSuperUserAccess()) {
throw $exception;
} /else {
if (!Piwik::isUserHasAdminAccess($idSite)) {
throw $exception;
return $autoArchive;

Please excuse my English. I hope you understand what I mean.

Thank you in advance for your efforts.

I wish you a Merry Christmas and a Happy New Year.


(Matthieu Aubry) #2

Hi Wesley,

Thanks for suggestion. Can you create a feature request / bug report in our issue tracker at: GitHub - matomo-org/matomo: Liberating Web Analytics. Star us on Github? +1. Matomo is the leading open alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites, apps & the IoT and visualise this data and extract insights. Privacy is built-in. We love Pull Requests!
we’ll follow up there

(Wesley Richards) #3

Hi Matt,
thanks for the reply.
I’ve it set as a new issue on Github.

Greeting Wesley