X-Git-Url: https://git-public.kairo.at/?a=blobdiff_plain;ds=sidebyside;f=app%2Fauthorize.php;h=81f95b1c5285426bafc770f85320010d8b1c2c9f;hb=651356998ad790ee2c059419f2b21568ae3e644d;hp=e0640800166c54d0ac009fbf87baeb79fab46e8a;hpb=00cd3ffebb3da530000a8215328fbfc949194275;p=authserver.git
diff --git a/app/authorize.php b/app/authorize.php
index e064080..81f95b1 100644
--- a/app/authorize.php
+++ b/app/authorize.php
@@ -11,22 +11,12 @@
// Include the common auth system files (including the OAuth2 Server object).
require_once(__DIR__.'/authsystem.inc.php');
-// Start HTML document as a DOM object.
-extract(ExtendedDocument::initHTML5()); // sets $document, $html, $head, $title, $body
-$document->formatOutput = true; // we want a nice output
-$style = $head->appendElement('link');
-$style->setAttribute('rel', 'stylesheet');
-$style->setAttribute('href', 'authsystem.css');
-$head->appendJSFile('authsystem.js');
-$title->appendText('Authorization Request | KaiRo.at');
-$h1 = $body->appendElement('h1', 'KaiRo.at Authentication Server');
-
$errors = $utils->checkForSecureConnection();
$utils->sendSecurityHeaders();
-$para = $body->appendElement('p', _('This login system does not work without JavaScript. Please activate JavaScript for this site to log in.'));
-$para->setAttribute('id', 'jswarning');
-$para->setAttribute('class', 'warn');
+// Initialize the HTML document with our basic elements.
+extract($utils->initHTMLDocument(sprintf(_('Authorization Request | %s'), $utils->settings['operator_name']),
+ sprintf(_('%s Authentication Server'), $utils->settings['operator_name']))); // sets $document, $html, $head, $title, $body
if (!count($errors)) {
$session = $utils->initSession(); // Read session or create new session and set cookie.
@@ -50,7 +40,8 @@ if (!count($errors)) {
$user = array('id' => 0, 'email' => '');
}
if (is_null($session)) {
- $errors[] = _('The session system is not working.').' '._('Please contact KaiRo.at and tell the team about this.');
+ $errors[] = _('The session system is not working.').' '
+ .sprintf(_('Please contact %s and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
elseif ($session['logged_in']) {
// We are logged in, process authorization request.
@@ -136,6 +127,13 @@ if (!count($errors)) {
$session = $utils->getLoginSession($user['id'], $session);
}
}
+ if ($settings['piwik_enabled']) {
+ // If we do not send out an HTML file, 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('Handle Authorize Request');
+ }
// Handle authorize request, forwarding code in GET parameters if the user has authorized your client.
$server->handleAuthorizeRequest($request, $response, $is_authorized, $user['id']);
/* For testing only