From 6b4b266182d3d66729634c7fec7286ef86332dbf Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sat, 3 Dec 2016 17:45:08 +0100 Subject: [PATCH] also put piwik tracking into token request --- app/token.php | 7 +++++++ 1 file changed, 7 insertions(+) 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(); -- 2.43.0