Skip to content
Snippets Groups Projects
Unverified Commit 4ea81c64 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Migrate the metadata template to look like the new federation page.

Also move the templates to the "saml" module, since they belong in there.
parent 42bf0129
No related branches found
No related tags found
No related merge requests found
File moved
{% set pagetile = 'SimpleSAMLphp Show Metadata'|trans %}
{% extends 'base.twig' %}
{% block content %}
<h2>{% trans %}Metadata{% endtrans %}</h2>
<dl>
<dd>{{ metadata_intro }}</dd>
{% if metaurl is defined %}
<dd>{% trans %}You can get the metadata xml on a dedicated URL:{% endtrans %}</dd>
<dd class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#url"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
<a class="pure-button hljs" href="{{ metaurl }}">
<span class="fa fa-external-link-square"></span>
</a>
</div>
<code id="url" class="code-box-content">{{ metaurl }}</code>
</dd>
{% endif %}
<dt>{% trans %}SAML Metadata{% endtrans %}</dt>
<dd>{% trans %}In SAML 2.0 Metadata XML format:{% endtrans %}</dd>
<dd class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#xml-metadata"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div>
<div id="xml-metadata" class="code-box-content xml">{{ metadata|raw }}</div>
</dd>
<dt>{% trans %}SimpleSAMLphp Metadata{% endtrans %}</dt>
<dd>{% trans %}Use this if you are using a SimpleSAMLphp entity on
{#- #} the other side:{% endtrans %}</dd>
<dd class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#php-metadata"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div>
<div id="php-metadata" class="code-box-content php">
{#- #}{{ metadataflat|raw }}{# -#}
</div>
</dd>
{% if certdata is defined %}
<dt>{% trans %}Certificates{% endtrans %}</dt>
<p>{% trans %}Download the X509 certificates as PEM-encoded files.{% endtrans %}</p>
<ul>
{% for cert in certdata %}
<li>
<a href="{{ cert.url }}"><i class="fa fa-download"></i>{{ cert.name }}
{#- #}{% if cert.signing %}-signing{% endif %}
{#- #}{% if cert.encryption %}-encryption{% endif %}.pem
{#- #}{% if cert.prefix %} ({% trans %}new{% endtrans %}){% endif %}</a> {{ cert.comment }}
</li>
{% endfor %}
</ul>
{% endif %}
</dl>
{% endblock content %}
\ No newline at end of file
......@@ -268,7 +268,7 @@ if (isset($metaArray20['attributes']) && is_array($metaArray20['attributes'])) {
$xml = \SimpleSAML\Metadata\Signer::sign($xml, $spconfig->toArray(), 'SAML 2 SP');
if (array_key_exists('output', $_REQUEST) && $_REQUEST['output'] == 'xhtml') {
$t = new \SimpleSAML\XHTML\Template($config, 'metadata.php', 'admin');
$t = new \SimpleSAML\XHTML\Template($config, 'saml:metadata.php', 'admin');
$t->data['clipboard.js'] = true;
$t->data['header'] = 'saml20-sp'; // TODO: Replace with headerString in 2.0
......
{% set pagetile = 'SimpleSAMLphp Show Metadata'|trans %}
{% extends 'base.twig' %}
{% block content %}
<h2>{{ header }}</h2>
<p>{{ metadata_intro }}</p>
{% if metaurl is defined %}
<p>{{ 'You can get the metadata xml on a dedicated URL:' | trans }}</p>
<div class="input-group">
<pre id="metadataurl" class="input-left">{{ metaurl }}</pre>
<button data-clipboard-target="#metadataurl" id="btnurl" class="pure-button right clipboard-btn copy">
<span class="fa fa-copy"></span>
</button>
</div>
{% endif %}
<h2>{{ 'Metadata' | trans }}</h2>
<div class="code-box">
<div class="code-box-title">
<p>{{ 'In SAML 2.0 Metadata XML format:' | trans }}</p>
<button data-clipboard-target="#xmlmetadata" id="btnxml" class="pure-button right clipboard-btn copy">
<span class="fa fa-copy"></span>
</button>
</div>
<div class="code-box-content">
<pre id="xmlmetadata">{{ metadata | raw }}</pre>
</div>
</div>
<div class="code-box">
<div class="code-box-title">
<p>{{ 'In SimpleSAMLphp flat file format - use this if you are using a SimpleSAMLphp entity on the other side:' | trans }}</p>
<button data-clipboard-target="#phpmetadata" id="btnphp" class="pure-button right clipboard-btn copy">
<span class="fa fa-copy"></span>
</button>
</div>
<div class="code-box-content">
<pre id="phpmetadata">{{ metadataflat | raw }}</pre>
</div>
</div>
{% if certdata is defined %}
<h2>{{ 'Certificates' |trans }}</h2>
<p>{{ 'Download the X509 certificates as PEM-encoded files.' |trans }}</p>
<ul>
{% for cert in certdata %}
<li><a href="{{ cert.url }}">{{ cert.name }}</a> {{ cert.comment }}</li>
{% endfor %}
</ul>
{% endif %}
{% endblock content %}
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