diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-03-28 03:42:39 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-03-28 03:42:40 +0400 |
commit | ae4b03163792f0b6e933933e5d37df87dc3fd566 (patch) | |
tree | d1d7510a9728f587d3d63ebd03e4ecf3d904838b /plugins/DoNotTrack | |
parent | 158c2150f5f2e13ece459b8d131244c11b763997 (diff) |
Mass conversion of all files to the newly agreed coding standard: PSR 1/2
Converting Piwik core source files, PHP, JS, TPL, CSS
More info: http://piwik.org/participate/coding-standards/
Diffstat (limited to 'plugins/DoNotTrack')
-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'); + } + } } |