From: Robert Kaiser Date: Sat, 3 Dec 2016 16:45:08 +0000 (+0100) Subject: also put piwik tracking into token request X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=6b4b266182d3d66729634c7fec7286ef86332dbf;p=authserver.git also put piwik tracking into token request --- diff --git a/app/token.php b/app/token.php index e934b14..6013f57 100644 --- a/app/token.php +++ b/app/token.php @@ -8,6 +8,13 @@ // Include the common auth system files (including the OAuth2 Server object). require_once(__DIR__.'/authsystem.inc.php'); +if ($settings['piwik_enabled']) { + // We do not send out an HTML file, so we need to do the Piwik tracking ourselves. + require_once($settings['piwik_tracker_path'].'PiwikTracker.php'); + PiwikTracker::$URL = ((strpos($settings['piwik_url'], '://') === false) ? 'http://localhost' : '' ).$settings['piwik_url']; + $piwikTracker = new PiwikTracker($idSite = $settings['piwik_site_id']); + $piwikTracker->doTrackPageView('Token Request'); +} $errors = $utils->checkForSecureConnection();