From 5faa275e56fb328cfeeea2b91a80102461344b90 Mon Sep 17 00:00:00 2001
From: mattab <matthieu.aubry@gmail.com>
Date: Wed, 5 Feb 2014 08:12:15 +1300
Subject: [PATCH] Minor

---
 plugins/PrivacyManager/Controller.php | 21 +++++++++------------
 tests/PHPUnit/UI                      |  2 +-
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/plugins/PrivacyManager/Controller.php b/plugins/PrivacyManager/Controller.php
index 0ea3dffefd..d7746bef3a 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 254e2d4ff4..1e7ebe4b7b 160000
--- a/tests/PHPUnit/UI
+++ b/tests/PHPUnit/UI
@@ -1 +1 @@
-Subproject commit 254e2d4ff48e44bcb15a28767fb77b741aa8d2e0
+Subproject commit 1e7ebe4b7b765c1b235bffe9f72b088957fc64bc
-- 
GitLab