Skip to content
Extraits de code Groupes Projets
Valider 45dd76d8 rédigé par peterbo's avatar peterbo
Parcourir les fichiers

Refs #2233, #2095, #2902 - set ip_address_mask_length and...

Refs #2233, #2095, #2902 - set ip_address_mask_length and ip_address_pre_mask_length on anonymizeIP-plugin activation. Synchronize both variables on PrivacyManager call.

git-svn-id: http://dev.piwik.org/svn/trunk@5772 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 7f4f48d0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -28,7 +28,7 @@ class Piwik_PrivacyManager_Controller extends Piwik_Controller_Admin ...@@ -28,7 +28,7 @@ class Piwik_PrivacyManager_Controller extends Piwik_Controller_Admin
case("formMaskLength"): case("formMaskLength"):
$this->handlePluginState(Piwik_Common::getRequestVar("anonymizeIPEnable", 0)); $this->handlePluginState(Piwik_Common::getRequestVar("anonymizeIPEnable", 0));
$maskLength = Zend_Registry::get('config')->Tracker; $maskLength = Zend_Registry::get('config')->Tracker;
$maskLength->ip_address_mask_length = Piwik_Common::getRequestVar("maskLength", 1); $maskLength->ip_address_mask_length = $maskLength->ip_address_pre_mask_length = Piwik_Common::getRequestVar("maskLength", 1);
Zend_Registry::get('config')->Tracker = $maskLength->toArray(); Zend_Registry::get('config')->Tracker = $maskLength->toArray();
break; break;
case("formDeleteSettings"): case("formDeleteSettings"):
...@@ -81,6 +81,17 @@ class Piwik_PrivacyManager_Controller extends Piwik_Controller_Admin ...@@ -81,6 +81,17 @@ class Piwik_PrivacyManager_Controller extends Piwik_Controller_Admin
$anonymizeIP["name"] = self::ANONYMIZE_IP_PLUGIN_NAME; $anonymizeIP["name"] = self::ANONYMIZE_IP_PLUGIN_NAME;
$anonymizeIP["enabled"] = Piwik_PluginsManager::getInstance()->isPluginActivated(self::ANONYMIZE_IP_PLUGIN_NAME); $anonymizeIP["enabled"] = Piwik_PluginsManager::getInstance()->isPluginActivated(self::ANONYMIZE_IP_PLUGIN_NAME);
$anonymizeIP["maskLength"] = Zend_Registry::get('config')->Tracker->ip_address_mask_length; $anonymizeIP["maskLength"] = Zend_Registry::get('config')->Tracker->ip_address_mask_length;
/**
* synchronize ip_address_mask_length and ip_address_pre_mask_length (changed in Piwik 1.7)
*/
$maskLength = Zend_Registry::get('config')->Tracker;
if (($maskLength->ip_address_mask_length != $maskLength->ip_address_pre_mask_length) &&
$anonymizeIP["enabled"] === true) {
$maskLength->ip_address_pre_mask_length = $maskLength->ip_address_mask_length;
Zend_Registry::get('config')->Tracker = $maskLength->toArray();
}
$anonymizeIP["info"] = Piwik_PluginsManager::getInstance()->getLoadedPlugin(self::ANONYMIZE_IP_PLUGIN_NAME)->getInformation(); $anonymizeIP["info"] = Piwik_PluginsManager::getInstance()->getLoadedPlugin(self::ANONYMIZE_IP_PLUGIN_NAME)->getInformation();
return $anonymizeIP; return $anonymizeIP;
...@@ -100,7 +111,7 @@ class Piwik_PrivacyManager_Controller extends Piwik_Controller_Admin ...@@ -100,7 +111,7 @@ class Piwik_PrivacyManager_Controller extends Piwik_Controller_Admin
$optionTable = Piwik_GetOption(self::OPTION_LAST_DELETE_PIWIK_LOGS); $optionTable = Piwik_GetOption(self::OPTION_LAST_DELETE_PIWIK_LOGS);
//If task was already rescheduled, read time from taskTimetable. Else, calculate next possible runtime. //If task was already rescheduled, read time from taskTimetable. Else, calculate next possible runtime.
if(!empty($scheduleTimetable) && ($scheduleTimetable - time() > 0)) { if (!empty($scheduleTimetable) && ($scheduleTimetable - time() > 0)) {
$nextPossibleSchedule = (int)$scheduleTimetable; $nextPossibleSchedule = (int)$scheduleTimetable;
} else { } else {
$date = Piwik_Date::factory("today"); $date = Piwik_Date::factory("today");
......
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