From a3b9c252d664731793c7076efb3e172098c4d4d4 Mon Sep 17 00:00:00 2001
From: Eric Jiang <eric@doublemap.com>
Date: Fri, 26 Sep 2014 09:48:10 -0400
Subject: [PATCH] Sort IdP's in alphabetical order in dropdown.

---
 templates/selectidp-dropdown.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/templates/selectidp-dropdown.php b/templates/selectidp-dropdown.php
index 27fbc36e7..8b2837524 100644
--- a/templates/selectidp-dropdown.php
+++ b/templates/selectidp-dropdown.php
@@ -38,6 +38,12 @@ foreach ($this->data['idplist'] AS $idpentry) {
 		<input type="hidden" name="returnIDParam" value="<?php echo htmlspecialchars($this->data['returnIDParam']); ?>" />
 		<select id="dropdownlist" name="idpentityid">
 		<?php
+
+		usort($this->data['idplist'], function($idpentry1, $idpentry2) {
+			return strcmp($this->t('idpname_' . $idpentry1['entityid']),
+			              $this->t('idpname_' . $idpentry2['entityid']));
+
+		});
 			
 		foreach ($this->data['idplist'] AS $idpentry) {
 
-- 
GitLab