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

Minor fixes in the new "test auth sources" page / templates.

parent 659fa317
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,6 @@ use SimpleSAML\HTTP\RunnableResponse;
use SimpleSAML\Locale\Translate;
use SimpleSAML\Utils\HTTP;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Controller class for the admin module.
......
......@@ -82,14 +82,14 @@ class TestController
$t = new \SimpleSAML\XHTML\Template($this->config, 'admin:status.twig', 'attributes');
$t->data = [
'attributes' => $attributes,
'attributesHtml' => $this->present_attributes($t, $attributes, ''),
'attributesHtml' => $this->getAttributesHTML($t, $attributes, ''),
'authData' => $authData,
'nameid' => $nameId,
'logouturl' => \SimpleSAML\Utils\HTTP::getSelfURLNoQuery().'?as='.urlencode($as).'&logout',
];
if ($nameId !== false) {
$this->data['nameidHtml'] = present_nameid($t, $nameId);
$this->data['nameidHtml'] = $this->getNameIDHTML($t, $nameId);
}
}
......@@ -99,7 +99,7 @@ class TestController
}
private function present_nameid(\SimpleSAML\XHTML\Template $t, \SAML2\XML\saml\NameID $nameId)
private function getNameIDHTML(\SimpleSAML\XHTML\Template $t, \SAML2\XML\saml\NameID $nameId)
{
$result = '';
if ($nameId->getValue() === null) {
......@@ -122,11 +122,11 @@ class TestController
$list['SPProvidedID'] = [$nameId->getSPProvidedID()];
}
}
return $result.present_attributes($t, $list, '');
return $result.$this->getAttributesHTML($t, $list, '');
}
private function present_attributes(\SimpleSAML\XHTML\Template $t, $attributes, $nameParent)
private function getAttributesHTML(\SimpleSAML\XHTML\Template $t, $attributes, $nameParent)
{
$alternate = ['pure-table-odd', 'pure-table-even'];
$i = 0;
......@@ -141,7 +141,7 @@ class TestController
$parentName = preg_replace('/^child_/', '', $nameraw);
foreach ($value as $child) {
$str .= '<tr class="odd"><td colspan="2" style="padding: 2em">'.
$this->present_attributes($t, $child, $parentName).'</td></tr>';
$this->getAttributesHTML($t, $child, $parentName).'</td></tr>';
}
} else {
if (sizeof($value) > 1) {
......
......@@ -6,7 +6,7 @@
{%- include "@admin/includes/menu.twig" %}
<ul>
{% for key, name in sources %}
<li><a href="test/{{ name|escape('url') }}">{{ name|escape('html') }}</a></li>
<li><a href="test/{{ name|escape('url') }}">{{ name }}</a></li>
{% endfor %}
</ul>
{% endblock %}
......@@ -4,9 +4,9 @@
{% block content %}
{%- include "@admin/includes/menu.twig" %}
<h2>{{ '{status:header_saml20_sp}'|trans }}</h2>
<p>{{ '{status:intro}'|trans }}</p>
<p>{% trans %}Hi, this is the status page of SimpleSAMLphp. Here you can see if your session is timed out, how long
it lasts until it times out and all the attributes that are attached to your session.{% endtrans %}</p>
<h2>{{ '{status:attributes_header}'|trans }}</h2>
......@@ -18,8 +18,8 @@
{%- endif %}
{% if authData -%}
<h2>{{ '{status:authData_header}'|trans }}</h2>
<details><summary>{{ '{status:authData_summary}'|trans }}</summary>
<h2>{% trans %}AuthData{% endtrans %}</h2>
<details><summary>{% trans %}Click to view AuthData{% endtrans %}</summary>
<pre>{{ authData|json_encode|raw }}</pre>
</details>
{%- endif %}
......
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