diff options
Diffstat (limited to 'plugins/CoreAdminHome/OptOutManager.php')
-rw-r--r-- | plugins/CoreAdminHome/OptOutManager.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/CoreAdminHome/OptOutManager.php b/plugins/CoreAdminHome/OptOutManager.php index eba6b88f6a..09e192bc35 100644 --- a/plugins/CoreAdminHome/OptOutManager.php +++ b/plugins/CoreAdminHome/OptOutManager.php @@ -355,10 +355,8 @@ HTML; _paq.push(['setCookiePath', settings.cookiePath]); } if (this.isUserOptedOut()) { - _paq.push(['forgetUserOptOut']); showContent(false, null, true); } else { - _paq.push(['optUserOut']); showContent(true, null, true); } }]); @@ -456,12 +454,16 @@ JS; } }, hasConsent: function() { - var value = this.getCookie(this.CONSENT_COOKIE_NAME); - if (this.getCookie(this.CONSENT_REMOVED_COOKIE_NAME) && value) { + var consentCookie = this.getCookie(this.CONSENT_COOKIE_NAME); + var removedCookie = this.getCookie(this.CONSENT_REMOVED_COOKIE_NAME); + if (!consentCookie && !removedCookie) { + return true; // No cookies set, so opted in + } + if (removedCookie && consentCookie) { this.setCookie(this.CONSENT_COOKIE_NAME, '', -129600000); return false; } - return (value || value !== 0); + return (consentCookie || consentCookie !== 0); }, consentGiven: function() { this.setCookie(this.CONSENT_REMOVED_COOKIE_NAME, '', -129600000); |