*/ class admin_plugin_adfs extends DokuWiki_Admin_Plugin { protected $xml = ''; public function handle() { global $INPUT; if ($INPUT->str('url')) { $http = new DokuHTTPClient(); $xml = $http->get($INPUT->str('url')); if ($xml === false) { msg('Failed to download metadata. ' . hsc($http->error), -1); } else { $this->xml = $xml; } } elseif ($INPUT->has('xml')) { header("X-XSS-Protection: 0"); $this->xml = $INPUT->str('xml'); } } public function html() { echo $this->locale_xhtml('intro'); $form = new \dokuwiki\Form\Form(); $form->addFieldsetOpen('Federation Metadata'); $urlinput = $form->addTextInput('url', 'Metadata Endpoint'); if ($this->xml) $urlinput->val('')->useInput(false); $form->addTextarea('xml', 'The XML Metadata')->val($this->xml)->useInput(false); $form->addButton('go', 'Submit')->attr('type', 'submit'); $form->addFieldsetClose(); echo $form->toHTML(); if ($this->xml) { $data = $this->metaData($this->xml); if (count($data)) { echo $this->locale_xhtml('found'); echo '
' . hsc($val) . '