Пример #1
0
 /**
  * @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.");
         $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');
     }
 }