diff options
Diffstat (limited to 'plugins/DoNotTrack/DoNotTrack.php')
-rw-r--r-- | plugins/DoNotTrack/DoNotTrack.php | 97 |
1 files changed, 48 insertions, 49 deletions
diff --git a/plugins/DoNotTrack/DoNotTrack.php b/plugins/DoNotTrack/DoNotTrack.php index e609f5e9af..16d8cbf7ed 100644 --- a/plugins/DoNotTrack/DoNotTrack.php +++ b/plugins/DoNotTrack/DoNotTrack.php @@ -18,58 +18,57 @@ */ class Piwik_DoNotTrack extends Piwik_Plugin { - /** - * Return information about this plugin. - * - * @see Piwik_Plugin - * - * @return array - */ - public function getInformation() - { - return array( - 'description' => Piwik_Translate('DoNotTrack_PluginDescription'), - 'author' => 'Piwik', - 'author_homepage' => 'http://piwik.org/', - 'version' => Piwik_Version::VERSION, - 'translationAvailable' => false, - 'TrackerPlugin' => true, - ); - } + /** + * Return information about this plugin. + * + * @see Piwik_Plugin + * + * @return array + */ + public function getInformation() + { + return array( + 'description' => Piwik_Translate('DoNotTrack_PluginDescription'), + 'author' => 'Piwik', + 'author_homepage' => 'http://piwik.org/', + 'version' => Piwik_Version::VERSION, + 'translationAvailable' => false, + 'TrackerPlugin' => true, + ); + } - public function getListHooksRegistered() - { - return array( - 'Tracker.Visit.isExcluded' => 'checkHeader', - ); - } + public function getListHooksRegistered() + { + return array( + 'Tracker.Visit.isExcluded' => 'checkHeader', + ); + } - /** - * @param Piwik_Event_Notification $notification notification object - */ - function checkHeader($notification) - { - if((isset($_SERVER['HTTP_X_DO_NOT_TRACK']) && $_SERVER['HTTP_X_DO_NOT_TRACK'] === '1') - || (isset($_SERVER['HTTP_DNT']) && substr($_SERVER['HTTP_DNT'], 0, 1) === '1')) - { - $ua = Piwik_Tracker_Visit::getUserAgent($_REQUEST); - if(strpos($ua, 'MSIE 10') !== false) - { - printDebug("INTERNET EXPLORER 10 Enables DNT by default, so Piwik ignores DNT for all IE10 browsers..."); - return; - } + /** + * @param Piwik_Event_Notification $notification notification object + */ + function checkHeader($notification) + { + if ((isset($_SERVER['HTTP_X_DO_NOT_TRACK']) && $_SERVER['HTTP_X_DO_NOT_TRACK'] === '1') + || (isset($_SERVER['HTTP_DNT']) && substr($_SERVER['HTTP_DNT'], 0, 1) === '1') + ) { + $ua = Piwik_Tracker_Visit::getUserAgent($_REQUEST); + if (strpos($ua, 'MSIE 10') !== false) { + printDebug("INTERNET EXPLORER 10 Enables DNT by default, so Piwik ignores DNT for all IE10 browsers..."); + return; + } - $exclude =& $notification->getNotificationObject(); - $exclude = true; - printDebug("DoNotTrack found."); + $exclude =& $notification->getNotificationObject(); + $exclude = true; + printDebug("DoNotTrack found."); - $trackingCookie = Piwik_Tracker_IgnoreCookie::getTrackingCookie(); - $trackingCookie->delete(); + $trackingCookie = Piwik_Tracker_IgnoreCookie::getTrackingCookie(); + $trackingCookie->delete(); - // this is an optional supplement to the site's tracking status resource at: - // /.well-known/dnt - // per Tracking Preference Expression (draft) - header('Tk: 1'); - } - } + // this is an optional supplement to the site's tracking status resource at: + // /.well-known/dnt + // per Tracking Preference Expression (draft) + header('Tk: 1'); + } + } } |