Skip to content
Snippets Groups Projects
Commit f6896a5e authored by Tim van Dijen's avatar Tim van Dijen
Browse files

core: Add a couple more Twig-templates

parent 23580978
No related branches found
No related tags found
No related merge requests found
Showing
with 142 additions and 19 deletions
......@@ -10,6 +10,6 @@ function consentAdmin_hook_frontpage(&$links) {
$links['config'][] = array(
'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'),
'text' => '{consentAdmin:consentadmin:consentadmin_header}',
'text' => '{core:frontpage:link_consentAdmin}',
);
}
......@@ -54,6 +54,30 @@ msgstr "OpenID Provider site - Alpha version (test code)"
msgid "{core:frontpage:link_doc_install}"
msgstr "Installing SimpleSAMLphp"
msgid "{core:frontpage:link_consentAdmin}"
msgstr "Consent Administration"
msgid "{core:frontpage:link_memcacheMonitor}"
msgstr "MemCache Statistics"
msgid "{core:frontpage:link_oauth}"
msgstr "OAuth Consumer Registry"
msgid "{core:frontpage:link_cron}"
msgstr "Cron module information page"
msgid "{core:frontpage:link_statistics}"
msgstr "Show statistics"
msgid "{core:frontpage:link_statistics_metadata}"
msgstr "Show statistics metadata"
msgid "{core:frontpage:link_metarefresh}"
msgstr "Metarefresh: fetch metadata"
msgid "{core:frontpage:link_santitycheck}"
msgstr "Sanity check of your SimpleSAMLphp setup"
msgid "{core:frontpage:link_diagnostics}"
msgstr "Diagnostics on hostname, port and protocol"
......
{% set pagetitle = 'Test Authentication Sources'|trans %}
{% extends "base.twig" %}
{% block content %}
<h1>{{ header }}</h1>
<ul>
{% for key, name in sources %}
<li><a href="?as={{ name|escape('url') }}">{{ name|escape('html') }}</a></li>
{% endfor %}
</ul>
{% endblock %}
{% set pagetitle = '{core:frontpage:page_title}'|trans %}
{% extends "base.twig" %}
{% block content %}
{% if isadmin %}
<p class="float-r youareadmin">{{ '{core:frontpage:loggedin_as_admin}'|trans }}</p>
{% else %}
<p class="float-r youareadmin">
<a href="{{ loginurl|escape('url') }}">{{ '{core:frontpage:login_as_admin}'|trans }}</a>
</p>
{% endif %}
<ul>
{% for key, link in links_auth %}
<li>
<a href="{{ link.href|escape('url') }}">{{ link.text|trans|escape('html') }}</a>
{% if link.deprecated is defined and link.deprecated is not empty %}
<span style="font-weight: bold;">{{ '{core:frontpage:deprecated}'|trans }}</b>
{% endif %}
</li>
{% endfor %}
</ul>
{% endblock %}
......@@ -40,11 +40,11 @@ if ($this->data['isadmin']) {
$icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/silk/delete.png" alt="disabled" />';
?>
<tr class="<?php echo $this->data['enablematrix']['saml20-idp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 IdP</td>
<td><?php echo $this->data['enablematrix']['saml20-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
<tr class="<?php echo $this->data['enablematrix']['saml20idp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 IdP</td>
<td><?php echo $this->data['enablematrix']['saml20idp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
<tr class="<?php echo $this->data['enablematrix']['shib13-idp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 IdP</td>
<td><?php echo $this->data['enablematrix']['shib13-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
<tr class="<?php echo $this->data['enablematrix']['shib13idp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 IdP</td>
<td><?php echo $this->data['enablematrix']['shib13idp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
</table>
</div>
......
{% set pagetitle = '{core:frontpage:page_title}'|trans %}
{% extends "base.twig" %}
{% block content %}
{% if isadmin %}
<p class="float-r youareadmin">{{ '{core:frontpage:loggedin_as_admin}'|trans }}</p>
{% else %}
<p class="float-r youareadmin">
<a href="{{ loginurl|escape('url') }}">{{ '{core:frontpage:login_as_admin}'|trans }}</a>
</p>
{% endif %}
<div style="margin-top: 1em;">
<code style="background: white; background: #f5f5f5; border: 1px dotted #bbb; padding: 1em; color: #555" >{{ directory }} ({{ version }})</code>
</div>
{% set icon_enabled = '<img src="/' ~ baseurlpath ~ 'resources/icons/silk/accept.png" alt="enabled" />' %}
{% set icon_disabled = '<img src="/' ~ baseurlpath ~ 'resources/icons/silk/delete.png" alt="disabled" />' %}
<div style="clear: both" class="enablebox mini">
<table>
<tr class="{%- if enablematrix.saml20idp %}enabled{% else %}disabled{% endif -%}">
<td>SAML 2.0 IdP</td>
<td>{%- if enablematrix.saml20idp %}{{ icon_enabled|raw }}{% else %}{{ icon_disabled|raw }}{% endif -%}</td>
</tr>
<tr class="{%- if enablematrix.shib13idp %}enabled{% else %}disabled{% endif -%}">
<td>Shib 1.3 IdP</td>
<td>{%- if enablematrix.shib13idp %}{{ icon_enabled|raw }}{% else %}{{ icon_disabled|raw }}{% endif -%}</td>
</tr>
</table>
</div>
<h2>{{ '{core:frontpage:configuration}'|trans }}</h2>
<ul>
{% for key, link in links_config %}
<li><a href="{{ link.href|escape('html') }}">{{ link.text|trans|escape('html') }}</a></li>
{% endfor %}
</ul>
{% if warnings is defined and warnings is not empty %}
<h2>{{ '{core:frontpage:warnings}'|trans|escape('html') }}</h2>
{% for key, warning in warnings %}
{% if warning is iterable %}
<div class="caution">{{ warning[0]|trans(warning[1], "app")|raw }}</div>
{% else %}
<div class="caution">{{ warning|trans|raw }}</div>
{% endif %}
{% endfor %}
{% endif %}
{% if isadmin %}
<h2>{{ '{core:frontpage:checkphp}'|trans }}</h2>
<div class="enablebox">
<table>
{% for key, func in funcmatrix %}
<tr class="{%- if func.enabled %}enabled{% else %}disabled{% endif -%}">
<td>{%- if func.enabled %}{{ icon_enabled|raw }}{% else %}{{ icon_disabled|raw }}{% endif -%}</td>
<td>{{ requiredmap[func.required]|trans }}</td>
<td>{{ func.descr }}</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
{% endblock %}
......@@ -5,6 +5,7 @@ $config = SimpleSAML_Configuration::getInstance();
if (!array_key_exists('as', $_REQUEST)) {
$t = new SimpleSAML_XHTML_Template($config, 'core:authsource_list.tpl.php');
$t->data['header'] = 'Test authentication sources';
$t->data['sources'] = SimpleSAML_Auth_Source::getSources();
$t->show();
exit();
......
......@@ -44,14 +44,13 @@ $t->data['pageid'] = 'frontpage_auth';
$t->data['isadmin'] = $isadmin;
$t->data['loginurl'] = $loginurl;
$t->data['header'] = $t->t('{core:frontpage:page_title}');
$t->data['links'] = $links;
$t->data['links_welcome'] = $links_welcome;
$t->data['links_config'] = $links_config;
$t->data['links_auth'] = $links_auth;
$t->data['links_federation'] = $links_federation;
$t->show();
......@@ -74,6 +74,8 @@ if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master')
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'SimpleSAMLphp');
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_PROXY, $config->getString('proxy', null));
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $config->getstring('proxy.auth', null));
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) {
......@@ -93,8 +95,8 @@ if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master')
}
$enablematrix = array(
'saml20-idp' => $config->getBoolean('enable.saml20-idp', false),
'shib13-idp' => $config->getBoolean('enable.shib13-idp', false),
'saml20idp' => $config->getBoolean('enable.saml20-idp', false),
'shib13idp' => $config->getBoolean('enable.shib13-idp', false),
);
......@@ -172,6 +174,7 @@ $funcmatrix[] = array(
$t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_config.tpl.php');
$t->data['pageid'] = 'frontpage_config';
$t->data['header'] = $t->t('{core:frontpage:page_title}');
$t->data['isadmin'] = $isadmin;
$t->data['loginurl'] = $loginurl;
$t->data['warnings'] = $warnings;
......
......@@ -10,7 +10,7 @@ function cron_hook_frontpage(&$links) {
$links['config'][] = array(
'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'),
'text' => array('en' => 'Cron module information page'),
'text' => '{core:frontpage:link_cron}',
);
}
......@@ -10,7 +10,7 @@ function memcacheMonitor_hook_frontpage(&$links) {
$links['config'][] = array(
'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'),
'text' => array('en' => 'MemCache Statistics'),
'text' => '{core:frontpage:link_memcacheMonitor}',
);
}
......@@ -10,7 +10,7 @@ function metarefresh_hook_frontpage(&$links) {
$links['federation'][] = array(
'href' => SimpleSAML\Module::getModuleURL('metarefresh/fetch.php'),
'text' => array('en' => 'Metarefresh: fetch metadata'),
'text' => '{core:frontpage:link_metarefresh}',
);
}
......@@ -11,7 +11,6 @@ function oauth_hook_frontpage(&$links)
$links['federation']['oauthregistry'] = array(
'href' => SimpleSAML\Module::getModuleURL('oauth/registry.php'),
'text' => array('en' => 'OAuth Consumer Registry'),
'shorttext' => array('en' => 'OAuth Registry'),
'text' => '{core:frontpage:link_oauth}',
);
}
......@@ -11,7 +11,6 @@ function sanitycheck_hook_frontpage(&$links)
$links['config']['santitycheck'] = array(
'href' => SimpleSAML\Module::getModuleURL('sanitycheck/index.php'),
'text' => array('en' => 'Sanity check of your SimpleSAMLphp setup'),
'shorttext' => array('en' => 'SanityCheck'),
'text' => '{core:frontpage:link_santitycheck}',
);
}
......@@ -11,12 +11,11 @@ function statistics_hook_frontpage(&$links)
$links['config']['statistics'] = array(
'href' => SimpleSAML\Module::getModuleURL('statistics/showstats.php'),
'text' => array('en' => 'Show statistics', 'no' => 'Vis statistikk'),
'shorttext' => array('en' => 'Statistics', 'no' => 'Statistikk'),
'text' => '{core:frontpage:link_statistics}',
);
$links['config']['statisticsmeta'] = array(
'href' => SimpleSAML\Module::getModuleURL('statistics/statmeta.php'),
'text' => array('en' => 'Show statistics metadata', 'no' => 'Vis statistikk metadata'),
'text' => '{core:frontpage:link_statistics_metadata}',
'shorttext' => array('en' => 'Statistics metadata', 'no' => 'Statistikk metadata'),
);
}
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