From e6b8c1290047adf577ab1c4c8d6a69b26e87b2ac Mon Sep 17 00:00:00 2001
From: diosmosis <benakamoorthi@fastmail.fm>
Date: Mon, 13 Jan 2014 02:21:06 +0000
Subject: [PATCH] Fixing build and removing some references to AnonymizeIP.

---
 core/Plugin/Manager.php                     | 1 -
 core/Tracker.php                            | 8 ++------
 core/Tracker/Visit.php                      | 2 +-
 plugins/CustomAlerts                        | 2 +-
 plugins/VisitorGenerator                    | 2 +-
 tests/PHPUnit/Core/ReleaseCheckListTest.php | 1 -
 tests/PHPUnit/IntegrationTestCase.php       | 3 +++
 7 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php
index dec9921093..87eeaa0e4b 100644
--- a/core/Plugin/Manager.php
+++ b/core/Plugin/Manager.php
@@ -65,7 +65,6 @@ class Manager extends Singleton
     );
 
     protected $corePluginsDisabledByDefault = array(
-        'AnonymizeIP',
         'DBStats',
         'DevicesDetection',
         'ExampleCommand',
diff --git a/core/Tracker.php b/core/Tracker.php
index 7c94b535a8..aaaa3cd567 100644
--- a/core/Tracker.php
+++ b/core/Tracker.php
@@ -755,9 +755,8 @@ class Tracker
         if (Common::getRequestVar('forceIpAnonymization', false, null, $args) == 1) {
             self::updateTrackerConfig('ip_address_mask_length', 2);
 
-            $section = Config::getInstance()->Plugins_Tracker;
-            $section['Plugins_Tracker'][] = "AnonymizeIP";
-            Config::getInstance()->Plugins_Tracker = $section;
+            self::connectDatabaseIfNotConnected();
+            \Piwik\Plugins\PrivacyManager\IPAnonymizer::activate();
 
             $forceIpAnonymization = true;
         }
@@ -780,9 +779,6 @@ class Tracker
             self::setForceVisitorId($customVisitorId);
         }
         $pluginsDisabled = array('Provider');
-        if (!$forceIpAnonymization) {
-            $pluginsDisabled[] = 'AnonymizeIP';
-        }
 
         // Disable provider plugin, because it is so slow to do many reverse ip lookups
         self::setPluginsNotToLoad($pluginsDisabled);
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php
index 0277bfd632..9862a61bce 100644
--- a/core/Tracker/Visit.php
+++ b/core/Tracker/Visit.php
@@ -94,7 +94,7 @@ class Visit implements VisitInterface
          * Triggered after visits are tested for exclusion so plugins can modify the IP address
          * persisted with a visit.
          * 
-         * This event is primarily used by the **AnonymizeIP** plugin to anonymize IP addresses.
+         * This event is primarily used by the **PrivacyManager** plugin to anonymize IP addresses.
          * 
          * @param string &$ip The visitor's IP address.
          */
diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts
index 78ae6de0ad..cc7e2a2e64 160000
--- a/plugins/CustomAlerts
+++ b/plugins/CustomAlerts
@@ -1 +1 @@
-Subproject commit 78ae6de0ad1c3a638f70f9aedf52b362fed4b6e9
+Subproject commit cc7e2a2e6473b3f7efdc75d67fde88957a4124b4
diff --git a/plugins/VisitorGenerator b/plugins/VisitorGenerator
index 700c71b483..f01efa321b 160000
--- a/plugins/VisitorGenerator
+++ b/plugins/VisitorGenerator
@@ -1 +1 @@
-Subproject commit 700c71b483a661da6a5fef7f49070de85631a576
+Subproject commit f01efa321b1add9e25e1fa84ec79048913831aa3
diff --git a/tests/PHPUnit/Core/ReleaseCheckListTest.php b/tests/PHPUnit/Core/ReleaseCheckListTest.php
index a241122c5d..86166fa1e1 100644
--- a/tests/PHPUnit/Core/ReleaseCheckListTest.php
+++ b/tests/PHPUnit/Core/ReleaseCheckListTest.php
@@ -122,7 +122,6 @@ class ReleaseCheckListTest extends PHPUnit_Framework_TestCase
     public function testCheckThatGivenPluginsAreDisabledByDefault()
     {
         $pluginsShouldBeDisabled = array(
-            'AnonymizeIP',
             'DBStats'
         );
         foreach ($pluginsShouldBeDisabled as $pluginName) {
diff --git a/tests/PHPUnit/IntegrationTestCase.php b/tests/PHPUnit/IntegrationTestCase.php
index 0db978d849..82f1172558 100755
--- a/tests/PHPUnit/IntegrationTestCase.php
+++ b/tests/PHPUnit/IntegrationTestCase.php
@@ -204,6 +204,9 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase
         
         \Piwik\SettingsPiwik::$cachedKnownSegmentsToArchive = null;
         \Piwik\CacheFile::$invalidateOpCacheBeforeRead = true;
+
+        \Piwik\Plugins\PrivacyManager\IPAnonymizer::deactivate();
+        \Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker::deactivate();
     }
 
     public static function tearDownAfterClass()
-- 
GitLab