Skip to content
Extraits de code Groupes Projets
Valider e891b140 rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

Refs #1736 Adding new setting to disable Segmentation for Anonymous user, as a preventive measure

git-svn-id: http://dev.piwik.org/svn/trunk@3873 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent fae5f9cf
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -81,6 +81,10 @@ site_selector_max_sites = 10 ...@@ -81,6 +81,10 @@ site_selector_max_sites = 10
; if set to 1, shows sparklines (evolution graph) in 'All Websites' report (MultiSites plugin) ; if set to 1, shows sparklines (evolution graph) in 'All Websites' report (MultiSites plugin)
show_multisites_sparklines = 1 show_multisites_sparklines = 1
; if set to 0, the anonymous user will not be able to use the 'segments' parameter in the API request
; this is useful to prevent full DB access to the anonymous user, or to limit performance usage
anonymous_user_enable_use_segments_API = 1
; this action name is used when the URL ends with a slash / ; this action name is used when the URL ends with a slash /
; it is useful to have an actual string to write in the UI ; it is useful to have an actual string to write in the UI
action_default_name = index action_default_name = index
......
...@@ -157,8 +157,14 @@ abstract class Piwik_Archive ...@@ -157,8 +157,14 @@ abstract class Piwik_Archive
$sites = Piwik_Site::getIdSitesFromIdSitesString($idSite); $sites = Piwik_Site::getIdSitesFromIdSitesString($idSite);
} }
// @TODO read setting enable segmentation
$segment = Piwik_Common::unsanitizeInputValue($segment); $segment = Piwik_Common::unsanitizeInputValue($segment);
if(!Zend_Registry::get('config')->General->anonymous_user_enable_use_segments_API
&& !empty($segment))
{
throw new Exception("The Super User has disabled the use of 'segments' for the anonymous user.
Please log in to use Segmentation in the API.");
}
$segment = new Piwik_Segment($segment, $idSite); $segment = new Piwik_Segment($segment, $idSite);
// idSite=1,3 or idSite=all // idSite=1,3 or idSite=all
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter