Skip to content
Snippets Groups Projects
Commit 7daa3ab1 authored by Olimpia Magliulo's avatar Olimpia Magliulo
Browse files

Merge commit '43ec1fe5' into Xnew-ui

parents 72709033 43ec1fe5
Branches
Tags
No related merge requests found
Showing
with 335 additions and 16 deletions
...@@ -10,6 +10,6 @@ function consentAdmin_hook_frontpage(&$links) { ...@@ -10,6 +10,6 @@ function consentAdmin_hook_frontpage(&$links) {
$links['config'][] = array( $links['config'][] = array(
'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'), '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)" ...@@ -54,6 +54,30 @@ msgstr "OpenID Provider site - Alpha version (test code)"
msgid "{core:frontpage:link_doc_install}" msgid "{core:frontpage:link_doc_install}"
msgstr "Installing SimpleSAMLphp" 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}" msgid "{core:frontpage:link_diagnostics}"
msgstr "Diagnostics on hostname, port and protocol" 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']) { ...@@ -40,11 +40,11 @@ if ($this->data['isadmin']) {
$icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/silk/delete.png" alt="disabled" />'; $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> <tr class="<?php echo $this->data['enablematrix']['saml20idp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 IdP</td>
<td><?php echo $this->data['enablematrix']['saml20-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> <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> <tr class="<?php echo $this->data['enablematrix']['shib13idp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 IdP</td>
<td><?php echo $this->data['enablematrix']['shib13-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> <td><?php echo $this->data['enablematrix']['shib13idp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
</table> </table>
</div> </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 %}
{% 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 %}
{% if metaentries.hosted is iterable and metaentries.hosted is not empty %}
<dl>
{% for key, set in metaentries.hosted %}
{% set metadataset = attribute(set, 'metadata-set') %}
<dt>{{ mtype[metadataset]|trans }}</dt>
<dd>
<p>Entity ID: {{ hm.entityid }}
{% if set.deprecated is defined and set.deprecated %}
<br /><span style="font-weight: bold;">Deprecated</span>
{% endif %}
{% if set.entityid != attribute(set, 'metadata-index') %}
<br />Index: {{ attribute(set, 'metadata-index') }}
{% endif %}
{% if set.name_translated is defined %}
<br /><span style="font-weight: bold;">{{ set.name_translated }}</span>
{% endif %}
{% if set.descr_translated is defined %}
<br /><span style="font-weight: bold;">{{ set.descr_translated }}</span>
{% endif %}
<br />[ <a href="{{ attribute(set, 'metadata-url') }}">{{'{core:frontpage:show_metadata}'|trans }}</a> ]
</p>
</dd>
{% endfor %}
</dl>
{% endif %}
{% if metaentries.remote is iterable and metaentries.remote is not empty %}
{% for key, set in metaentries.remote %}
<fieldset class="fancyfieldset">
<legend>{{ mtype[key]|trans }} (Trusted)</legend>
<ul>
{% for entityid, entity in set %}
<li><a href="{{ (metadata_url ~ '?entityid=' ~ entity.entityid ~ '&set=' ~ key)|escape('html') }}">
{%- if entity.name_translated is defined %}
{{ entity.name_translated }}
{% elseif entity.organizationdisplayname_translated is defined %}
{{ entity.organizationdisplayname_translated }}
{% else %}{{ entity.entityid|escape('html') }}
{% endif -%}</a>
{%- if entity.expire is defined %}
{% if entity.expire > date().timestamp %}
<span style="color: #500; font-weight: bold"> (expired {{ ((date().timestamp - entity.expire) / 3600) }} hours ago)</span>
{% else %} (expires in {{ ((entity.expire - date().timestamp) / 3600) }} hours){% endif -%}{% endif %}
</li>
{% endfor %}
</ul>
</fieldset>
{% endfor %}
{% endif %}
<h2>{{ '{core:frontpage:tools}'|trans }}</h2>
<ul>
{% for key, link in links_federation %}
<li><a href="{{ link.href|escape('html') }}">{{ link.text|trans|escape('html') }}</a></li>
{% endfor %}
</ul>
{% if isadmin %}
<fieldset class="fancyfieldset">
<legend>Lookup metadata</legend>
<form action="{{ metadata_url }}" method="get">
<p style="margin: 1em 2em ">Look up metadata for entity:
<select name="set">
{% if metaentries.remote is defined and metaentries.remote is not empty %}
{% for key, set in metaentries.remote %}
<option value="{{ key|escape('html') }}">{{ mtype[key]|trans }}</option>
{% endfor %}
{% endif %}
</select>
<input type="text" name="entityid" />
<button class="btn" type="submit">Lookup </button>
</p>
</form>
</fieldset>
{% endif %}
{% 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 %}
<p>{{ '{core:frontpage:intro}'|trans|raw }}</p>
<ul>
{% for key, link in links_welcome %}
<li><a href="{{ link.href|escape('html') }}">{{ link.text|trans|escape('html') }}</a></li>
{% endfor %}
</ul>
<h2>{{ '{core:frontpage:about_header}'|trans }}</h2>
<p>{{ '{core:frontpage:about_text}'|trans|raw }}</p>
{% endblock %}
{% set pagetitle = '{logout:progress}'|trans %}
{% extends "base.twig" %}
{% block content %}
{# pretty arbitrary height, but should have enough safety margins for most cases #}
{% set iframeHeight = (25 + (SPs|length * 4)) %}
<iframe style="width:100%; height: {{ iframeHeight }}em; border:0;" src="logout-iframe.php?type=embed&id={{ auth_state|escape('url') }}"></iframe>
{% for assocId, sp in SPs %}
{% if attribute(sp, 'core:Logout-IFrame:State') == 'inprogress' %}
<iframe style="width:0; height:0; border:0;" src="{{ attribute(sp, 'core:Logout-IFrame:URL')|escape('html') }}</iframe>
{% endif %}
{% endfor %}
{% endblock %}
{% set pagetitle = '{core:no_cookie:header}'|trans %}
{% extends "base.twig" %}
{% block content %}
<h2>{{ header }}</h2>
<p>{{ description }}</p>
{% if retryURL is not null %}
<ul>
<li><a href="{{ retryURL|escape('html') }}" id="retry">{{ retry }}</a></li>
</ul>
{% endif %}
{% endblock %}
{% set pagetitle = 'SimpleSAMLphp'|trans %}
{% extends "base.twig" %}
{% block content %}
<h1>{{ header }}</h1>
<form style="display: inline; margin: 0px; padding: 0px" action="{{ target|escape('html') }}">
{% for name, value in params %}
<input type="hidden" name="{{ name|escape('html') }}" value="{{ value|escape('html') }}" />
{% endfor %}
<p>{{ '{core:short_sso_interval:warning}'|trans }}</p>
<div class="trackidtext">
<p>{{ '{errors:report_trackid}'|trans }}<span class="trackid">{{ trackId }}</span></p>
</div>
<input type="submit" name="continue" id="contbutton" value="'{core:short_sso_interval:retry}'|trans|escape('html') }}" />
</form>
{% endblock %}
{% set pagetile = ''|trans %} {% set pagetile = 'SimpleSAMLphp Show Metadata'|trans %}
{% extends 'base.twig' %} {% extends 'base.twig' %}
{% block content %} {% block content %}
<div class="code-box"> <div class="code-box">
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
</button> </button>
</div> </div>
<div class="code-box-content"> <div class="code-box-content">
<pre id="metadata">$metadata[{{ metadata_index }}] => {{ m|escape }}</pre> <pre id="metadata">$metadata[{{ entityid }}] => {{ metadata|escape }}</pre>
</div> </div>
</div> </div>
<div class="center"> <div class="center">
{# TODO: translation needed #} {# TODO: translation needed #}
<a href="{{ backlink }}" class="pure-button pure-button-red">{{ 'Back'|trans }}</a> <a href="{{ backlink }}" class="pure-button pure-button-red">{{ 'Back'|trans }}</a>
</div> </div>
{% endblock content %} {% endblock content %}
\ No newline at end of file
...@@ -5,6 +5,7 @@ $config = SimpleSAML_Configuration::getInstance(); ...@@ -5,6 +5,7 @@ $config = SimpleSAML_Configuration::getInstance();
if (!array_key_exists('as', $_REQUEST)) { if (!array_key_exists('as', $_REQUEST)) {
$t = new SimpleSAML_XHTML_Template($config, 'core:authsource_list.tpl.php'); $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->data['sources'] = SimpleSAML_Auth_Source::getSources();
$t->show(); $t->show();
exit(); exit();
......
...@@ -44,14 +44,13 @@ $t->data['pageid'] = 'frontpage_auth'; ...@@ -44,14 +44,13 @@ $t->data['pageid'] = 'frontpage_auth';
$t->data['isadmin'] = $isadmin; $t->data['isadmin'] = $isadmin;
$t->data['loginurl'] = $loginurl; $t->data['loginurl'] = $loginurl;
$t->data['header'] = $t->t('{core:frontpage:page_title}');
$t->data['links'] = $links; $t->data['links'] = $links;
$t->data['links_welcome'] = $links_welcome; $t->data['links_welcome'] = $links_welcome;
$t->data['links_config'] = $links_config; $t->data['links_config'] = $links_config;
$t->data['links_auth'] = $links_auth; $t->data['links_auth'] = $links_auth;
$t->data['links_federation'] = $links_federation; $t->data['links_federation'] = $links_federation;
$t->show(); $t->show();
...@@ -74,6 +74,8 @@ if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master') ...@@ -74,6 +74,8 @@ if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master')
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'SimpleSAMLphp'); curl_setopt($ch, CURLOPT_USERAGENT, 'SimpleSAMLphp');
curl_setopt($ch, CURLOPT_TIMEOUT, 2); 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); $response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) { if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) {
...@@ -93,8 +95,8 @@ if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master') ...@@ -93,8 +95,8 @@ if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master')
} }
$enablematrix = array( $enablematrix = array(
'saml20-idp' => $config->getBoolean('enable.saml20-idp', false), 'saml20idp' => $config->getBoolean('enable.saml20-idp', false),
'shib13-idp' => $config->getBoolean('enable.shib13-idp', false), 'shib13idp' => $config->getBoolean('enable.shib13-idp', false),
); );
...@@ -172,6 +174,7 @@ $funcmatrix[] = array( ...@@ -172,6 +174,7 @@ $funcmatrix[] = array(
$t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_config.tpl.php'); $t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_config.tpl.php');
$t->data['pageid'] = 'frontpage_config'; $t->data['pageid'] = 'frontpage_config';
$t->data['header'] = $t->t('{core:frontpage:page_title}');
$t->data['isadmin'] = $isadmin; $t->data['isadmin'] = $isadmin;
$t->data['loginurl'] = $loginurl; $t->data['loginurl'] = $loginurl;
$t->data['warnings'] = $warnings; $t->data['warnings'] = $warnings;
......
...@@ -117,6 +117,36 @@ foreach ($metaentries['remote'] as $key => $value) { ...@@ -117,6 +117,36 @@ foreach ($metaentries['remote'] as $key => $value) {
$t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_federation.tpl.php'); $t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_federation.tpl.php');
$language = $t->getLanguage();
$defaultLanguage = $config->getString('language.default', 'en');
$translators = array(
'name' => 'name_translated',
'descr' => 'descr_translated',
'OrganizationDisplayName' => 'organizationdisplayname_translated',
);
foreach ($metaentries['hosted'] as $index => $entity) {
foreach ($translators as $old => $new) {
if (isset($entity[$old][$language])) {
$metaentries['hosted'][$index][$new] = $entity[$old][$language];
} elseif ($entity[$old][$defaultLanguage]) {
$metaentries['hosted'][$index][$new] = $entity[$old][$defaultLanguage];
}
}
}
foreach ($metaentries['remote'] as $key => $set) {
foreach ($set as $entityid => $entity) {
foreach ($translators as $old => $new) {
if (isset($entity[$old][$language])) {
$metaentries['remote'][$key][$entityid][$new] = $entity[$old][$language];
} elseif ($entity[$old][$defaultLanguage]) {
$metaentries['remote'][$key][$entityid][$new] = $entity[$old][$defaultLanguage];
}
}
}
}
# look up translated string # look up translated string
$mtype = array( $mtype = array(
'saml20-sp-remote' => $t->noop('{admin:metadata_saml20-sp}'), 'saml20-sp-remote' => $t->noop('{admin:metadata_saml20-sp}'),
...@@ -143,12 +173,11 @@ $t->data['links_welcome'] = $links_welcome; ...@@ -143,12 +173,11 @@ $t->data['links_welcome'] = $links_welcome;
$t->data['links_config'] = $links_config; $t->data['links_config'] = $links_config;
$t->data['links_auth'] = $links_auth; $t->data['links_auth'] = $links_auth;
$t->data['links_federation'] = $links_federation; $t->data['links_federation'] = $links_federation;
$t->data['header'] = $t->t('{core:frontpage:page_title}');
$t->data['metadata_url'] = SimpleSAML\Module::getModuleURL('core/show_metadata.php');
$t->data['metaentries'] = $metaentries; $t->data['metaentries'] = $metaentries;
$t->data['mtype'] = $mtype; $t->data['mtype'] = $mtype;
$t->show(); $t->show();
...@@ -57,7 +57,7 @@ $t->data['links_welcome'] = $links_welcome; ...@@ -57,7 +57,7 @@ $t->data['links_welcome'] = $links_welcome;
$t->data['links_config'] = $links_config; $t->data['links_config'] = $links_config;
$t->data['links_auth'] = $links_auth; $t->data['links_auth'] = $links_auth;
$t->data['links_federation'] = $links_federation; $t->data['links_federation'] = $links_federation;
$t->data['header'] = $t->t('{core:frontpage:page_title}');
......
...@@ -122,6 +122,8 @@ if ($type === 'nojs') { ...@@ -122,6 +122,8 @@ if ($type === 'nojs') {
$t = new SimpleSAML_XHTML_Template($globalConfig, $template_id); $t = new SimpleSAML_XHTML_Template($globalConfig, $template_id);
$t->data['auth_state'] = $id; $t->data['auth_state'] = $id;
$t->data['header'] = $t->t('{logout:progress}');
/** /**
* @deprecated The "id" variable will be removed. Please use "auth_state" instead. * @deprecated The "id" variable will be removed. Please use "auth_state" instead.
*/ */
......
...@@ -9,5 +9,9 @@ if (isset($_REQUEST['retryURL'])) { ...@@ -9,5 +9,9 @@ if (isset($_REQUEST['retryURL'])) {
$globalConfig = SimpleSAML_Configuration::getInstance(); $globalConfig = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig, 'core:no_cookie.tpl.php'); $t = new SimpleSAML_XHTML_Template($globalConfig, 'core:no_cookie.tpl.php');
$t->data['header'] = htmlspecialchars($t->t('{core:no_cookie:header}'));
$t->data['description'] = htmlspecialchars($t->t('{core:no_cookie:description}'));
$t->data['retry'] = htmlspecialchars($t->t('{core:no_cookie:retry}'));
$t->data['retryURL'] = $retryURL; $t->data['retryURL'] = $retryURL;
$t->show(); $t->show();
...@@ -23,4 +23,6 @@ $t = new SimpleSAML_XHTML_Template($globalConfig, 'core:short_sso_interval.php') ...@@ -23,4 +23,6 @@ $t = new SimpleSAML_XHTML_Template($globalConfig, 'core:short_sso_interval.php')
$t->data['target'] = SimpleSAML\Module::getModuleURL('core/short_sso_interval.php'); $t->data['target'] = SimpleSAML\Module::getModuleURL('core/short_sso_interval.php');
$t->data['params'] = array('StateId' => $id); $t->data['params'] = array('StateId' => $id);
$t->data['trackId'] = $session->getTrackID(); $t->data['trackId'] = $session->getTrackID();
$this->data['header'] = $this->t('{core:short_sso_interval:warning_header}');
$this->data['autofocus'] = 'contbutton';
$t->show(); $t->show();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment