Skip to content
Snippets Groups Projects
Commit 8293337e authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Reformat and enhance the page that shows individual metadata entities.

parent 26317b41
No related branches found
No related tags found
No related merge requests found
<?php <?php
$this->includeAtTemplateBase('includes/header.php');
$this->includeAtTemplateBase('includes/header.php');
?> ?>
<pre class="metadatabox"> <div class="metadatabox">
<button data-clipboard-target="#metadata" id="btncp" class="btn topright" style="margin-right: 0.5em;">
<img src="<?php echo $this->data['baseurlpath'].'/resources/icons/clipboard.svg'; ?>"
alt="Copy to clipboard">
</button>
<pre id="metadata">
$metadata['<?php echo $this->data['m']['metadata-index']; unset($this->data['m']['metadata-index']) ?>'] => <?php $metadata['<?php echo $this->data['m']['metadata-index']; unset($this->data['m']['metadata-index']) ?>'] => <?php
echo htmlspecialchars(var_export($this->data['m'], true)); echo htmlspecialchars(var_export($this->data['m'], true));
?> ?>
</pre> </pre>
<p>[ <a href="<?php echo $this->data['backlink']; ?>">back</a> ]</p> </div>
<script type="text/javascript">
var clipboard = new Clipboard('#btncp');
</script>
<br/>
<p><a href="<?php echo $this->data['backlink']; ?>"><span class="btn">Back</span></a></p>
<?php <?php
$this->includeAtTemplateBase('includes/footer.php'); $this->includeAtTemplateBase('includes/footer.php');
<?php <?php
// load configuration
/* Load simpleSAMLphp, configuration */
$config = SimpleSAML_Configuration::getInstance(); $config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getSessionFromRequest(); $session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML\Utils\Auth::requireAdmin(); SimpleSAML\Utils\Auth::requireAdmin();
if (!array_key_exists('entityid', $_REQUEST)) {
if (!array_key_exists('entityid', $_REQUEST)) throw new Exception('required parameter [entityid] missing');
throw new Exception('required parameter [entityid] missing'); }
if (!array_key_exists('set', $_REQUEST)) if (!array_key_exists('set', $_REQUEST)) {
throw new Exception('required parameter [set] missing'); throw new Exception('required parameter [set] missing');
if (!in_array($_REQUEST['set'], array('saml20-idp-remote', 'saml20-sp-remote', 'shib13-idp-remote', 'shib13-sp-remote'))) }
throw new Exception('Invalid set'); if (!in_array(
$_REQUEST['set'],
array('saml20-idp-remote', 'saml20-sp-remote', 'shib13-idp-remote', 'shib13-sp-remote')
)) {
throw new Exception('Invalid set');
}
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
$m = $metadata->getMetadata($_REQUEST['entityid'], $_REQUEST['set']); $m = $metadata->getMetadata($_REQUEST['entityid'], $_REQUEST['set']);
$t = new SimpleSAML_XHTML_Template($config, 'core:show_metadata.tpl.php'); $t = new SimpleSAML_XHTML_Template($config, 'core:show_metadata.tpl.php');
$t->data['clipboard.js'] = true;
$t->data['pageid'] = 'show_metadata'; $t->data['pageid'] = 'show_metadata';
$t->data['header'] = 'simpleSAMLphp Show Metadata'; $t->data['header'] = 'simpleSAMLphp Show Metadata';
$t->data['backlink'] = SimpleSAML_Module::getModuleURL('core/frontpage_federation.php'); $t->data['backlink'] = SimpleSAML_Module::getModuleURL('core/frontpage_federation.php');
$t->data['m'] = $m; $t->data['m'] = $m;
$t->show(); $t->show();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment