Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

SegmentEditor API throws NoAccessException #4679

Closed
sgiehl opened this Issue · 2 comments

2 participants

@sgiehl
Collaborator

Some parts of Piwik are not loading correct.

Precondition (to reproduce local):

Setup Piwik with a website (e.g. ID 1). Grant anonymous view access to that website. Logout of Piwik and visit the Visitors Overview. The report shouldn't load.

Reason:
A NoAccessException is thrown which causes an error while loading the report with ajax

I've debugged that issue. The Exception is thrown within the segmenteditor api (https://github.com/piwik/piwik/blob/master/plugins/SegmentEditor/API.php#L277).
See full backtrace below.

URL on the demo to reproduce:

http://demo.piwik.org/index.php?date=yesterday&module=VisitsSummary&action=index&idSite=7&period=day

Full Backtrace for the Exception:


#0 /var/www/piwik/core/Piwik.php(451): Piwik\Access->checkUserHasSuperUserAccess()
#1 /var/www/piwik/plugins/SegmentEditor/API.php(277): Piwik\Piwik::checkUserHasSuperUserAccess()
#2 /var/www/piwik/plugins/SegmentEditor/SegmentEditor.php(57): Piwik\Plugins\SegmentEditor\API->getAll(false, true)
#3 [internal function]: Piwik\Plugins\SegmentEditor\SegmentEditor->getKnownSegmentsToArchiveAllSites(Array)
#4 /var/www/piwik/core/EventDispatcher.php(98): call_user_func_array(Array, Array)
#5 /var/www/piwik/core/Piwik.php(778): Piwik\EventDispatcher->postEvent('Segments.getKno...', Array, false, NULL)
#6 /var/www/piwik/core/SettingsPiwik.php(88): Piwik\Piwik::postEvent('Segments.getKno...', Array)
#7 /var/www/piwik/core/ArchiveProcessor/Rules.php(67): Piwik\SettingsPiwik::getKnownSegmentsToArchive()
#8 /var/www/piwik/core/ArchiveProcessor/Rules.php(55): Piwik\ArchiveProcessor\Rules::shouldProcessReportsAllPlugins(Object(Piwik\Segment), 'day')
#9 /var/www/piwik/core/Archive.php(647): Piwik\ArchiveProcessor\Rules::getDoneStringFlagFor(Object(Piwik\Segment), 'day', 'VisitsSummary')
#10 /var/www/piwik/core/Archive.php(531): Piwik\Archive->getDoneStringForPlugin('VisitsSummary')
#11 /var/www/piwik/core/Archive.php(490): Piwik\Archive->getArchiveIds(Array)
#12 /var/www/piwik/core/Archive.php(339): Piwik\Archive->get(Array, 'numeric')
#13 /var/www/piwik/plugins/VisitsSummary/API.php(59): Piwik\Archive->getDataTableFromNumeric(Array)
#14 [internal function]: Piwik\Plugins\VisitsSummary\API->get('1', 'day', '2014-01-15,2014...', 'visitorType==re...', 'nb_visits,nb_ac...')
#15 /var/www/piwik/core/API/Proxy.php(209): call_user_func_array(Array, Array)
#16 /var/www/piwik/core/API/Request.php(215): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'get', Array)
#17 /var/www/piwik/core/API/Request.php(301): Piwik\API\Request->process()
#18 /var/www/piwik/plugins/VisitFrequency/API.php(47): Piwik\API\Request::processRequest('VisitsSummary.g...', Array)
#19 [internal function]: Piwik\Plugins\VisitFrequency\API->get('1', 'day', '2014-01-15,2014...', false, 'nb_visits_retur...')
#20 /var/www/piwik/core/API/Proxy.php(209): call_user_func_array(Array, Array)
#21 /var/www/piwik/plugins/API/API.php(451): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'get', Array)
#22 [internal function]: Piwik\Plugins\API\API->get('1', 'day', '2014-01-15,2014...', false, false)
#23 /var/www/piwik/core/API/Proxy.php(209): call_user_func_array(Array, Array)
#24 /var/www/piwik/core/API/Request.php(215): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'get', Array)
#25 /var/www/piwik/core/ViewDataTable/Request.php(48): Piwik\API\Request->process()
#26 /var/www/piwik/core/Plugin/ViewDataTable.php(271): Piwik\ViewDataTable\Request->loadDataTableFromAPI(Array)
#27 /var/www/piwik/core/Plugin/Visualization.php(166): Piwik\Plugin\ViewDataTable->loadDataTableFromAPI(Array)
#28 /var/www/piwik/core/Plugin/ViewDataTable.php(358): Piwik\Plugin\Visualization->buildView()
#29 /var/www/piwik/core/Plugin/Controller.php(200): Piwik\Plugin\ViewDataTable->render()
#30 /var/www/piwik/plugins/VisitsSummary/Controller.php(94): Piwik\Plugin\Controller->renderView(Object(Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution))
#31 /var/www/piwik/plugins/VisitsSummary/Controller.php(29): Piwik\Plugins\VisitsSummary\Controller->getEvolutionGraph(Array)
#32 [internal function]: Piwik\Plugins\VisitsSummary\Controller->index()
#33 /var/www/piwik/core/FrontController.php(521): call_user_func_array(Array, Array)
#34 /var/www/piwik/core/FrontController.php(84): Piwik\FrontController->doDispatch(NULL, NULL, NULL)
#35 /var/www/piwik/core/dispatch.php(30): Piwik\FrontController->dispatch()
#36 /var/www/piwik/index.php(47): require_once('/var/www/piwik/...')
#37 {main}#0 /var/www/piwik/core/Piwik.php(451): Piwik\Access->checkUserHasSuperUserAccess()
@tsteur
Owner

In 1238ea3: refs #4679 splitted this method into 3 methods and extracted them into a model so we do not have to check for permission when archiving

@tsteur
Owner

In bf21210: refs #4679 do not add any segments in case user does not have super user access

@sgiehl sgiehl added this to the 2.1 - Piwik 2.1 milestone
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4679 splitted this method into 3 methods and extracted them int…
…o a model so we do not have to check for permission when archiving
1238ea3
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4679 do not add any segments in case user does not have super u…
…ser access
bf21210
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.