Exemplo n.º 1
0
 function checkHeader($notification)
 {
     $setting = @Piwik_Tracker_Config::getInstance()->Tracker['do_not_track'];
     if ($setting === '1' && (isset($_SERVER['HTTP_X_DO_NOT_TRACK']) && $_SERVER['HTTP_X_DO_NOT_TRACK'] === '1' || isset($_SERVER['HTTP_DNT']) && $_SERVER['HTTP_DNT'] === '1')) {
         $exclude =& $notification->getNotificationObject();
         $exclude = true;
         $trackingCookie = Piwik_Tracker_IgnoreCookie::getTrackingCookie();
         $trackingCookie->delete();
     }
 }
Exemplo n.º 2
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') {
         $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');
     }
 }
Exemplo n.º 3
0
 /**
  * Shows the "Track Visits" checkbox.
  */
 public function optOut()
 {
     $trackVisits = !Piwik_Tracker_IgnoreCookie::isIgnoreCookieFound();
     $nonce = Piwik_Common::getRequestVar('nonce', false);
     $language = Piwik_Common::getRequestVar('language', '');
     if ($nonce !== false && Piwik_Nonce::verifyNonce('Piwik_OptOut', $nonce)) {
         Piwik_Nonce::discardNonce('Piwik_OptOut');
         Piwik_Tracker_IgnoreCookie::setIgnoreCookie();
         $trackVisits = !$trackVisits;
     }
     $view = Piwik_View::factory('optOut');
     $view->trackVisits = $trackVisits;
     $view->nonce = Piwik_Nonce::getNonce('Piwik_OptOut', 3600);
     $view->language = Piwik_LanguagesManager_API::getInstance()->isLanguageAvailable($language) ? $language : Piwik_LanguagesManager::getLanguageCodeForCurrentUser();
     echo $view->render();
 }
Exemplo n.º 4
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');
     }
 }
Exemplo n.º 5
0
	public function setIgnoreCookie()
	{
		Piwik::checkUserHasSomeViewAccess();
		Piwik::checkUserIsNotAnonymous();
		$this->checkTokenInUrl();
		Piwik_Tracker_IgnoreCookie::setIgnoreCookie();
		Piwik::redirectToModule('UsersManager', 'userSettings');
	}
Exemplo n.º 6
0
 /**
  * Looks for the ignore cookie that users can set in the Piwik admin screen.
  * @return bool
  */
 protected function isIgnoreCookieFound()
 {
     if (Piwik_Tracker_IgnoreCookie::isIgnoreCookieFound()) {
         printDebug('Piwik ignore cookie was found, visit not tracked.');
         return true;
     }
     return false;
 }