From aaf51c6bf40e32ac6e7ca40feb05e0e4dadba44f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20P=C3=A9rez=20Crespo?= <jaime.perez@uninett.no>
Date: Thu, 27 Feb 2014 09:44:19 +0000
Subject: [PATCH] Honour UIInfo/DisplayName in IdP's metadata in the IdP
 selection templates.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3398 44740490-163a-0410-bde0-09ae8108e29a
---
 templates/selectidp-dropdown.php | 4 +++-
 templates/selectidp-links.php    | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/templates/selectidp-dropdown.php b/templates/selectidp-dropdown.php
index c7aaa1c60..6f54bbf52 100644
--- a/templates/selectidp-dropdown.php
+++ b/templates/selectidp-dropdown.php
@@ -10,7 +10,9 @@ $this->data['autofocus'] = 'dropdownlist';
 $this->includeAtTemplateBase('includes/header.php');
 
 foreach ($this->data['idplist'] AS $idpentry) {
-	if (isset($idpentry['name'])) {
+	if (isset($idpentry['UIInfo']['DisplayName'])) {
+		$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['UIInfo']['DisplayName']);
+	} elseif (isset($idpentry['name'])) {
 		$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['name']);
 	} elseif (isset($idpentry['OrganizationDisplayName'])) {
 		$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['OrganizationDisplayName']);
diff --git a/templates/selectidp-links.php b/templates/selectidp-links.php
index 85aa3ca8b..076352512 100644
--- a/templates/selectidp-links.php
+++ b/templates/selectidp-links.php
@@ -10,7 +10,9 @@ $this->data['autofocus'] = 'preferredidp';
 $this->includeAtTemplateBase('includes/header.php');
 
 foreach ($this->data['idplist'] AS $idpentry) {
-	if (isset($idpentry['name'])) {
+	if (isset($idpentry['UIInfo']['DisplayName'])) {
+		$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['UIInfo']['DisplayName']);
+	} elseif (isset($idpentry['name'])) {
 		$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['name']);
 	} elseif (isset($idpentry['OrganizationDisplayName'])) {
 		$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['OrganizationDisplayName']);
-- 
GitLab