示例#1
0
        if ($entry['flag'] !== null) {
            echo '<img class="metalisting_flag" src="' . $entry['flag'] . '" alt="' . $entry['flag_name'] . '" />';
        }
        echo $entry['prettyname'];
        if ($entry['url'] !== null) {
            echo ' [ <a href="' . $t->getTranslation(SimpleSAML_Utilities::arrayize($entry['url'], 'en')) . '">more</a> ]';
        }
        echo '</td></tr>';
    }
    echo '</tbody>';
    echo '</table>';
}
if (!empty($this->data['metaentries']['saml20-idp'])) {
    echo '<h2>' . $this->t('{janus:dashboard:text_saml20-idp}') . '</h2>';
    listMetadata($this, $this->data['metaentries']['saml20-idp'], $this->data['workflowstates']);
}
if (!empty($this->data['metaentries']['shib13-idp'])) {
    echo '<h2>' . $this->t('{janus:dashboard:text_shib13-idp}') . '</h2>';
    listMetadata($this, $this->data['metaentries']['shib13-idp'], $this->data['workflowstates']);
}
if (!empty($this->data['metaentries']['saml20-sp'])) {
    echo '<h2>' . $this->t('{janus:dashboard:text_saml20-sp}') . '</h2>';
    listMetadata($this, $this->data['metaentries']['saml20-sp'], $this->data['workflowstates']);
}
if (!empty($this->data['metaentries']['shib13-sp'])) {
    echo '<h2>' . $this->t('{janus:dashboard:text_shib13-sp}') . '</h2>';
    echo '<h2>' . $this->t('text_shib13-sp') . '</h2>';
    listMetadata($this, $this->data['metaentries']['shib13-sp'], $this->data['workflowstates']);
}
echo '</div>';
$this->includeAtTemplateBase('includes/footer.php');
?>
' align='absmiddle' /> Loading...</span>
</form>
<p />

<?php 
if (isset($typeString)) {
    if (!isset($metadataTypeMap[$typeString])) {
        if (isset($_REQUEST['type']) && $_REQUEST['type']) {
            displayError("Invalid metadata type type: {$typeString}", false, true);
        }
        exit;
    }
    $type = $metadataTypeMap[$typeString];
    $_SESSION['defaultMetadataType'] = $typeString;
    $metadataComponents = listMetadata($type);
    $componentsLabel = "Components (" . count($metadataComponents) . ")";
    $tree = new ExpandableTree("listMetadataTree", array("Type Description" => $type, $componentsLabel => $metadataComponents));
    $tree->setForceCollapse($typeStringChanged);
    $tree->setContainsIds(true);
    $tree->setContainsDates(true);
    $tree->printTree();
}
require_once 'footer.php';
function listMetadata($type)
{
    try {
        if (isset($type->childXmlName)) {
            return processListMetadataResult(WorkbenchContext::get()->getMetadataConnection()->listMetadata($type->childXmlName, null, WorkbenchContext::get()->getApiVersion()));
        }
        if (!$type->inFolder) {
        if (isset($flag)) {
            echo ' <img style="display: inline; margin-right: 5px" src="' . $flag . '" alt="Flag" />';
        }
        if (array_key_exists('name', $entry)) {
            echo $t->getTranslation(SimpleSAML_Utilities::arrayize($entry['name'], 'en'));
        } else {
            echo $entry['entityid'];
        }
        // echo('<pre>'); print_r($entry); echo('</pre>');
        if ($extended) {
            if (array_key_exists('expire', $entry)) {
                if ($entry['expire'] < $now) {
                    echo '<span style="color: #500; font-weight: bold"> (expired ' . number_format(($now - $entry['expire']) / 3600, 1) . ' hours ago)</span>';
                } else {
                    echo '<span style="color: #ccc; "> (expires in ' . number_format(($entry['expire'] - $now) / 3600, 1) . ' hours)</span>';
                }
            }
        }
        if (array_key_exists('url', $entry)) {
            echo ' [ <a href="' . $t->getTranslation(SimpleSAML_Utilities::arrayize($entry['url'], 'en')) . '">more</a> ]';
        }
        echo '</li>';
    }
    echo '</ul>';
    echo '</fieldset>';
}
echo '<h2>Identity Providers</h2>';
listMetadata($this, $this->data['metaentries']['remote']['saml20-idp-remote'], $this->data['extended']);
echo '<h2>Service Providers</h2>';
listMetadata($this, $this->data['metaentries']['remote']['saml20-sp-remote'], $this->data['extended']);
$this->includeAtTemplateBase('includes/footer.php');