+ // 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');
+
+ $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');
+
+ $form = $body->appendForm('', 'POST', 'authform');
+ $form->setAttribute('id', 'authform');
+ $form->appendElement('p', sprintf(_('Do you authorize %s to access %s?'), $request->query['client_id'], $request->query['scope']));
+ $submit = $form->appendInputSubmit(_('yes'));
+ $submit->setAttribute('name', 'authorized');
+ $form->appendText(' ');
+ $submit = $form->appendInputSubmit(_('no'));
+ $submit->setAttribute('name', 'authorized');
+ // Send HTML to client.
+ print($document->saveHTML());
+ exit();