Skip to content
Snippets Groups Projects
Commit cf82d4b3 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Add links to metadata entries in the federation tab to view the raw content of...

Add links to metadata entries in the federation tab to view the raw content of the remote metadata entries...

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1765 44740490-163a-0410-bde0-09ae8108e29a
parent 6c3d7eb9
No related branches found
No related tags found
No related merge requests found
...@@ -75,12 +75,15 @@ foreach($this->data['metaentries']['remote'] AS $setkey => $set) { ...@@ -75,12 +75,15 @@ foreach($this->data['metaentries']['remote'] AS $setkey => $set) {
echo '<ul>'; echo '<ul>';
foreach($set AS $entry) { foreach($set AS $entry) {
echo '<li>'; echo '<li>';
echo ('<a href="' .
SimpleSAML_Module::getModuleURL('core/show_metadata.php?entityid=' . urlencode($entry['entityid']) . '&amp;set=' . urlencode($setkey) ) .
'">');
if (array_key_exists('name', $entry)) { if (array_key_exists('name', $entry)) {
echo $this->getTranslation(SimpleSAML_Utilities::arrayize($entry['name'], 'en')); echo $this->getTranslation(SimpleSAML_Utilities::arrayize($entry['name'], 'en'));
} else { } else {
echo $entry['entityid']; echo $entry['entityid'];
} }
echo '</a>';
if (array_key_exists('expire', $entry)) { if (array_key_exists('expire', $entry)) {
if ($entry['expire'] < $now) { if ($entry['expire'] < $now) {
echo('<span style="color: #500; font-weight: bold"> (expired ' . number_format(($now - $entry['expire'])/3600, 1) . ' hours ago)</span>'); echo('<span style="color: #500; font-weight: bold"> (expired ' . number_format(($now - $entry['expire'])/3600, 1) . ' hours ago)</span>');
...@@ -112,13 +115,39 @@ foreach($this->data['metaentries']['remote'] AS $setkey => $set) { ...@@ -112,13 +115,39 @@ foreach($this->data['metaentries']['remote'] AS $setkey => $set) {
?> ?>
</ul> </ul>
<?php
if ($this->data['isadmin']) {
?>
<fieldset class="fancyfieldset"><legend>Lookup metadata</legend>
<form action="<?php echo SimpleSAML_Module::getModuleURL('core/show_metadata.php'); ?>" method="get" >
<p style="margin: 1em 2em ">Look up metadata for entity:
<select name="set">
<?php
if (is_array($this->data['metaentries']['remote']) && count($this->data['metaentries']['remote']) > 0) {
foreach($this->data['metaentries']['remote'] AS $setkey => $set) {
echo '<option value="' . htmlspecialchars($setkey) . '">' . $this->t(mtype($setkey)) . '</option>';
}
}
?>
</select>
<input type="text" name="entityid">
<input type="submit" value="Lookup">
</p>
</form>
</fieldset>
<?php
}
?>
......
<?php
$this->includeAtTemplateBase('includes/header.php');
echo('<pre style="font-size: 110%">');
echo(htmlentities(var_export($this->data['m'])));
echo('</pre>');
echo('<p>[ <a href="' . $this->data['backlink'] . '"> back </a> ]</p>');
$this->includeAtTemplateBase('includes/footer.php');
<?php
/* Load simpleSAMLphp, configuration */
$config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getInstance();
SimpleSAML_Utilities::requireAdmin();
if (!array_key_exists('entityid', $_REQUEST))
throw new Exception('required parameter [entityid] missing');
if (!array_key_exists('set', $_REQUEST))
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');
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
$m = $metadata->getMetadata($_REQUEST['entityid'], $_REQUEST['set']);
// echo('<pre>'); print_r($m);
// exit;
$t = new SimpleSAML_XHTML_Template($config, 'core:show_metadata.tpl.php');
$t->data['pageid'] = 'show_metadata';
$t->data['header'] = 'simpleSAMLphp Show Metadata';
$t->data['backlink'] = SimpleSAML_Module::getModuleURL('core/frontpage_federation.php');
$t->data['m'] = $m;
$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