Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wesleyscottrichards opened this issue Jan 5, 2015 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@wesleyscottrichards
Copy link

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 ontrollerAdmin 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.

Wesley

@mattab
Copy link
Member

mattab commented Jan 6, 2015

Hi @wesleyscottrichards can you please upgrade to 2.10.0 ? the code looks already different as we fixed some issues there. see #6767 #6373 #5923 etc

@mattab mattab closed this as completed Jan 6, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Jan 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants