diff --git a/modules/admin/lib/Controller/Federation.php b/modules/admin/lib/Controller/Federation.php index 949b6aeb907a09415bb896a64d47d2652a088dee..b1b2cabbb270fc6a202e80c89dbb4217d7d12c0f 100644 --- a/modules/admin/lib/Controller/Federation.php +++ b/modules/admin/lib/Controller/Federation.php @@ -149,29 +149,6 @@ class Federation } } - $translators = [ - 'name' => 'name_translated', - 'descr' => 'descr_translated', - 'OrganizationDisplayName' => 'organizationdisplayname_translated', - ]; - - foreach ($entries['remote'] as $key => $set) { - foreach ($set as $entityid => $entity) { - foreach ($translators as $old => $new) { - if (isset($entity[$old][$language])) { - $entries['remote'][$key][$entityid][$new] = $entity[$old][$language]; - } elseif (isset($entity[$old][$defaultLang])) { - $entries['remote'][$key][$entityid][$new] = $entity[$old][$defaultLang]; - } elseif (isset($entity[$old]['en'])) { - $entries['remote'][$key][$entityid][$new] = $entity[$old]['en']; - } elseif (isset($entries['remote'][$key][$entityid][$old])) { - $old_entry = $entries['remote'][$key][$entityid][$old]; - $entries['remote'][$key][$entityid][$new] = is_array($old_entry) ? $entityid : $old_entry; - } - } - } - } - $t->data = [ 'links' => [ [ diff --git a/modules/admin/templates/federation.twig b/modules/admin/templates/federation.twig index 300ab0811f8f60f82fd245c828aed9fcebeb030e..6ae2aa26f52982c222a84af993f43ec265321f76 100644 --- a/modules/admin/templates/federation.twig +++ b/modules/admin/templates/federation.twig @@ -16,10 +16,7 @@ {%- block general %} <dl> - {%- if set.name is defined %} - - <dt>{{ set.name|translateFromArray }}</dt> - {%- endif %} + <dt>{{ set|entityDisplayName }}</dt> <dd>EntityID: <code>{{ set.entityid }}</code></dd> {%- if set.deprecated is defined and set.deprecated %} @@ -105,16 +102,7 @@ {% for entityid, entity in set %} <li><a href="{{ moduleURL('admin/federation/show?entityid=' ~ (entity.entityid|url_encode) ~ '&set=' ~ key) }}"> - {%- if entity.name_translated is defined -%} - - {{ entity.name_translated }} - {%- elseif entity.organizationdisplayname_translated is defined -%} - - {{ entity.organizationdisplayname_translated }} - {%- else -%} - - {{ entity.entityid|escape('html') }} - {%- endif -%} + {{ entity | entityDisplayName }} </a> {% if entity.expire is defined %} {% if entity.expire < date().timestamp %} diff --git a/modules/saml/templates/proxy/invalid_session.twig b/modules/saml/templates/proxy/invalid_session.twig index 593adca27ace9b143b6209ab459279102453ac0d..23161a1c8c35ca8aaabbcbb72696907190b710b4 100644 --- a/modules/saml/templates/proxy/invalid_session.twig +++ b/modules/saml/templates/proxy/invalid_session.twig @@ -3,10 +3,10 @@ {% block content %} <h2>{{ 'Invalid Identity Provider'|trans }}</h2> - <p>{{ 'You already have a valid session with an identity provider (<em>%IDP%</em>) that is not accepted by <em>%SP%</em>. Would you like to log out from your existing session and log in again with another identity provider?'|trans({"%IDP%": idp_name|translateFromArray|default(idp_entityid), "%SP%": sp_name|translateFromArray|default(sp_entityid)}, "app")|raw</p> + <p>{{ 'You already have a valid session with an identity provider (<em>%IDP%</em>) that is not accepted by <em>%SP%</em>. Would you like to log out from your existing session and log in again with another identity provider?'|trans({"%IDP%": entity_idp|entityDiplayName, "%SP%": entity_sp|entityDisplayName}, "app")|raw</p> <form method="post" action="?"> - <input type="hidden" name="AuthState" value="{{ AuthState|escape('html') }}" /> - <input type="submit" name="continue" value="{{ 'Yes, continue'|trans }}" /> - <input type="submit" name="cancel" value="{{ 'No, cancel'|trans }}" /> + <input type="hidden" name="AuthState" value="{{ AuthState|escape('html') }}"> + <input type="submit" name="continue" value="{{ 'Yes, continue'|trans }}"> + <input type="submit" name="cancel" value="{{ 'No, cancel'|trans }}"> </form> {% endblock %} diff --git a/modules/saml/www/proxy/invalid_session.php b/modules/saml/www/proxy/invalid_session.php index 9dd31b5250cd9e1dd9846df3dfa86c57a2d8f2c9..5a95f2a78e40fb5f7c3f74819e6dbbf0a2bc54d1 100644 --- a/modules/saml/www/proxy/invalid_session.php +++ b/modules/saml/www/proxy/invalid_session.php @@ -48,27 +48,11 @@ if (isset($_POST['continue'])) { $cfg = \SimpleSAML\Configuration::getInstance(); $template = new \SimpleSAML\XHTML\Template($cfg, 'saml:proxy/invalid_session.twig'); -$translator = $template->getTranslator(); $template->data['AuthState'] = (string) $_REQUEST['AuthState']; -// get the name of the IdP $idpmdcfg = $state['saml:sp:IdPMetadata']; /** @var \SimpleSAML\Configuration $idpmdcfg */ -$idpmd = $idpmdcfg->toArray(); -if (array_key_exists('name', $idpmd)) { - $template->data['idp_name'] = $idpmd['name']; -} elseif (array_key_exists('OrganizationDisplayName', $idpmd)) { - $template->data['idp_name'] = $idpmd['OrganizationDisplayName']; -} -$template->data['idp_entityid'] = $idpmd['entityid']; - -// get the name of the SP -$spmd = $state['SPMetadata']; -if (array_key_exists('name', $spmd)) { - $template->data['sp_name'] = $spmd['name']; -} elseif (array_key_exists('OrganizationDisplayName', $spmd)) { - $template->data['sp_name'] = $spmd['OrganizationDisplayName']; -} -$template->data['sp_entityid'] = $spmd['entityid']; +$template->data['entity_idp'] = $idpmdcfg->toArray(); +$template->data['entity_sp'] = $state['SPMetadata']; $template->send();