diff --git a/plugins/PrivacyManager/Controller.php b/plugins/PrivacyManager/Controller.php index 0ea3dffefd922def572a39fc1ec403c9118d1871..d7746bef3a946f86af0e0cfe73637f8c4eb61b77 100644 --- a/plugins/PrivacyManager/Controller.php +++ b/plugins/PrivacyManager/Controller.php @@ -38,7 +38,15 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $this->checkTokenInUrl(); switch (Common::getRequestVar('form')) { case("formMaskLength"): - $this->handlePluginState(Common::getRequestVar("anonymizeIPEnable", 0)); + $enable = Common::getRequestVar("anonymizeIPEnable", 0); + if ($enable == 1) { + IPAnonymizer::activate(); + } else if ($enable == 0) { + IPAnonymizer::deactivate(); + } else { + // pass + } + $privacyConfig = new Config(); $privacyConfig->ipAddressMaskLength = Common::getRequestVar("maskLength", 1); $privacyConfig->useAnonymizedIpForVisitEnrichment = Common::getRequestVar("useAnonymizedIpForVisitEnrichment", 1); @@ -283,17 +291,6 @@ class Controller extends \Piwik\Plugin\ControllerAdmin return $deleteDataInfos; } - protected function handlePluginState($state = 0) - { - if ($state == 1) { - IPAnonymizer::activate(); - } else if ($state == 0) { - IPAnonymizer::deactivate(); - } else { - // pass - } - } - public function deactivateDoNotTrack() { Piwik::checkUserHasSuperUserAccess(); diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI index 254e2d4ff48e44bcb15a28767fb77b741aa8d2e0..1e7ebe4b7b765c1b235bffe9f72b088957fc64bc 160000 --- a/tests/PHPUnit/UI +++ b/tests/PHPUnit/UI @@ -1 +1 @@ -Subproject commit 254e2d4ff48e44bcb15a28767fb77b741aa8d2e0 +Subproject commit 1e7ebe4b7b765c1b235bffe9f72b088957fc64bc