From f215f8856f0dfdd8142a42cb9a46bd000031ac20 Mon Sep 17 00:00:00 2001
From: Jacob Christiansen <jach@wayf.dk>
Date: Wed, 31 Mar 2010 13:17:27 +0000
Subject: [PATCH] Multiauth: Added functionality to bypass the select source
 page if the authsource id is known. Append 'source=AUTHSOURCEID' to query to
 apply.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2245 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/multiauth/lib/Auth/Source/MultiAuth.php | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/multiauth/lib/Auth/Source/MultiAuth.php b/modules/multiauth/lib/Auth/Source/MultiAuth.php
index 6bf557235..7bfbe154f 100644
--- a/modules/multiauth/lib/Auth/Source/MultiAuth.php
+++ b/modules/multiauth/lib/Auth/Source/MultiAuth.php
@@ -81,7 +81,13 @@ class sspmod_multiauth_Auth_Source_MultiAuth extends SimpleSAML_Auth_Source {
 		saved state array as a parameter to the login form */
 		$url = SimpleSAML_Module::getModuleURL('multiauth/selectsource.php');
 		$params = array('AuthState' => $id);
-		SimpleSAML_Utilities::redirect($url, $params);
+        
+        // Allowes the user to specify the auth souce to be used
+        if(isset($_GET['source'])) {
+            $params['source'] = $_GET['source'];    
+        }
+		
+        SimpleSAML_Utilities::redirect($url, $params);
 
 		/* The previous function never returns, so this code is never
 		executed */
@@ -148,4 +154,4 @@ class sspmod_multiauth_Auth_Source_MultiAuth extends SimpleSAML_Auth_Source {
 
 }
 
-?>
\ No newline at end of file
+?>
-- 
GitLab