diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-12-08 05:50:36 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-12-08 05:50:36 +0300 |
commit | 7e8b6c258ffdb579910049c9b7f0d42f931d5508 (patch) | |
tree | b66e4f8ca8d937102bb6d8c299bf40e33610d7f9 | |
parent | dca8fe4e075357ab5310d8213a669cc217e092ef (diff) |
fixes https://github.com/PiwikPRO/plugin-InterSites/issues/2 Added notification to user when Config not setup properly + Update system tests to set the new required config
-rw-r--r-- | core/Tracker.php | 5 | ||||
-rw-r--r-- | core/Tracker/Visit.php | 2 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/Tracker/SettingsTest.php | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/core/Tracker.php b/core/Tracker.php index 99a712a887..cb7b4494c5 100644 --- a/core/Tracker.php +++ b/core/Tracker.php @@ -242,6 +242,11 @@ class Tracker } // Tests can force the use of 3rd party cookie for ID visitor + if (Common::getRequestVar('forceEnableFingerprintingAcrossWebsites', false, null, $args) == 1) { + TrackerConfig::setConfigValue('enable_fingerprinting_across_websites', 1); + } + + // Tests can force the use of 3rd party cookie for ID visitor if (Common::getRequestVar('forceUseThirdPartyCookie', false, null, $args) == 1) { TrackerConfig::setConfigValue('use_third_party_id_cookie', 1); } diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php index ee4bd97a11..4065ebe15c 100644 --- a/core/Tracker/Visit.php +++ b/core/Tracker/Visit.php @@ -386,7 +386,9 @@ class Visit implements VisitInterface protected function getSettingsObject() { if (is_null($this->userSettings)) { + // Note: this config settig is also checked in the InterSites plugin $isSameFingerprintAcrossWebsites = (bool)Config::getInstance()->Tracker['enable_fingerprinting_across_websites']; + $this->userSettings = new Settings( $this->request, $this->getVisitorIp(), $isSameFingerprintAcrossWebsites ); } diff --git a/tests/PHPUnit/Integration/Tracker/SettingsTest.php b/tests/PHPUnit/Integration/Tracker/SettingsTest.php index fa2dee2969..fc008467a4 100644 --- a/tests/PHPUnit/Integration/Tracker/SettingsTest.php +++ b/tests/PHPUnit/Integration/Tracker/SettingsTest.php @@ -117,10 +117,10 @@ class SettingsTest extends IntegrationTestCase public function test_getConfigId_isSame_whenIPIsAnonimisedAndBothSame() { - $settingsIpIsNotAnon = $this->makeSettings(array(), true, '125.2.0.0'); $settingsIpIsAnon = $this->makeSettings(array(), true, '125.2.0.0'); + $settingsIpIsAnonBis = $this->makeSettings(array(), true, '125.2.0.0'); - $this->assertSame($settingsIpIsNotAnon->getConfigId(), $settingsIpIsAnon->getConfigId()); + $this->assertSame($settingsIpIsAnonBis->getConfigId(), $settingsIpIsAnon->getConfigId()); } /** |