From 3b40ce6259ef9b88055e839f353d8a8523224ef5 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 26 Oct 2010 08:43:45 +0000
Subject: [PATCH] SimpleSAML_Auth_Simple: Don't overwrite existing restart url.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2606 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Auth/Simple.php | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/SimpleSAML/Auth/Simple.php b/lib/SimpleSAML/Auth/Simple.php
index e6b2f13f7..b45d07bed 100644
--- a/lib/SimpleSAML/Auth/Simple.php
+++ b/lib/SimpleSAML/Auth/Simple.php
@@ -111,13 +111,14 @@ class SimpleSAML_Auth_Simple {
 		}
 
 
-		/*
-		 * An URL to restart the authentication, in case the user bookmarks
-		 * something, e.g. the discovery service page.
-		 */
-		$restartURL = $this->getLoginURL($returnTo);
-
-		$params[SimpleSAML_Auth_State::RESTART] = $restartURL;
+		if (!isset($params[SimpleSAML_Auth_State::RESTART])) {
+			/*
+			 * An URL to restart the authentication, in case the user bookmarks
+			 * something, e.g. the discovery service page.
+			 */
+			$restartURL = $this->getLoginURL($returnTo);
+			$params[SimpleSAML_Auth_State::RESTART] = $restartURL;
+		}
 
 		SimpleSAML_Auth_Default::initLogin($this->authSource, $returnTo, $errorURL, $params);
 		assert('FALSE');
-- 
GitLab