also put piwik tracking into token request
authorRobert Kaiser <kairo@kairo.at>
Sat, 3 Dec 2016 16:45:08 +0000 (17:45 +0100)
committerRobert Kaiser <kairo@kairo.at>
Sat, 3 Dec 2016 16:45:08 +0000 (17:45 +0100)
app/token.php

index e934b141bf85ec9b59a8af5c2dfcb71e66597145..6013f57ec5c7ff773b8359ef8f27e71cf2dbf2a6 100644 (file)
@@ -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();