From 969271fe93760c80c9d930084bd50fc5fce171c9 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Wed, 18 Nov 2009 08:14:55 +0000
Subject: [PATCH] Auth_Default: Extend $hints to be generic parameters for the
 authentication source.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1996 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Auth/Default.php | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/lib/SimpleSAML/Auth/Default.php b/lib/SimpleSAML/Auth/Default.php
index ca4221db8..cdffbc5aa 100644
--- a/lib/SimpleSAML/Auth/Default.php
+++ b/lib/SimpleSAML/Auth/Default.php
@@ -22,16 +22,15 @@ class SimpleSAML_Auth_Default {
 	 * @param string $returnURL  The URL we should direct the user to after authentication.
 	 * @param string|NULL $errorURL  The URL we should direct the user to after failed authentication.
 	 *                               Can be NULL, in which case a standard error page will be shown.
-	 * @param array $hints  Extra information about the login. Different authentication requestors may
-	 *                      provide different information. Optional, will default to an empty array.
+	 * @param array $params  Extra information about the login. Different authentication requestors may
+	 *                       provide different information. Optional, will default to an empty array.
 	 */
-	public static function initLogin($authId, $returnURL, $errorURL = NULL, $hints = array()) {
+	public static function initLogin($authId, $returnURL, $errorURL = NULL, array $params = array()) {
 		assert('is_string($authId)');
 		assert('is_string($returnURL)');
 		assert('is_string($errorURL) || is_null($errorURL)');
-		assert('is_array($hints)');
 
-		$state = array(
+		$state = array_merge($params, array(
 			'SimpleSAML_Auth_Default.id' => $authId,
 			'SimpleSAML_Auth_Default.ReturnURL' => $returnURL,
 			'SimpleSAML_Auth_Default.ErrorURL' => $errorURL,
@@ -39,19 +38,8 @@ class SimpleSAML_Auth_Default {
 			'LogoutCallback' => array(get_class(), 'logoutCallback'),
 			'LogoutCallbackState' => array(
 				'SimpleSAML_Auth_Default.logoutSource' => $authId,
-				),
-			);
-
-		if (array_key_exists('SPMetadata', $hints)) {
-			$state['SPMetadata'] = $hints['SPMetadata'];
-		}
-		if (array_key_exists('IdPMetadata', $hints)) {
-			$state['IdPMetadata'] = $hints['IdPMetadata'];
-		}
-
-		if (array_key_exists(SimpleSAML_Auth_State::RESTART, $hints)) {
-			$state[SimpleSAML_Auth_State::RESTART] = $hints[SimpleSAML_Auth_State::RESTART];
-		}
+			),
+		));
 
 		if ($errorURL !== NULL) {
 			$state[SimpleSAML_Auth_State::EXCEPTION_HANDLER_URL] = $errorURL;
-- 
GitLab