From 73d6a2bbf5300fbf5d85902d29e82f56d5025ef9 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 25 May 2010 16:35:08 +0200 Subject: [PATCH] Allow to specify the URL parameter name for the alternate login setting. --- horde/config/conf.xml | 11 ++++++++++- horde/docs/CHANGES | 1 + horde/login.php | 7 ++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/horde/config/conf.xml b/horde/config/conf.xml index 3dd224068..7501d0742 100644 --- a/horde/config/conf.xml +++ b/horde/config/conf.xml @@ -158,7 +158,16 @@ an attacker to hijack the session.">true false + place of horde's default login screen. The URL will have an "app" + parameter appended that contains the application that redirected to the + login screen, and a "url" parameter with the originally requested + URL. The alternate login screen should redirect to that URL after + authentication. Alternatively you can include a "%u" place holder + in the alternate URL that will be replaced by that original + URL. Optionally appended URL parameters are "logout_reason" that + contains a number with the logout reason (see the Horde_Auth::REASON_* + constants for possible values), and "logout_msg" that contains an + error message describing the logout reason.">false false diff --git a/horde/docs/CHANGES b/horde/docs/CHANGES index 16a952f7b..5f462bbca 100644 --- a/horde/docs/CHANGES +++ b/horde/docs/CHANGES @@ -2,6 +2,7 @@ v4.0-cvs -------- +[jan] Allow to specify the URL parameter name for the alternate login setting. [mms] Remove reliance on PEAR Mail library. [jan] Send alarm emails again if the alarm has changed (Bug #8717). [mms] Add advanced preferences options screen. diff --git a/horde/login.php b/horde/login.php index 28dfa50df..66dfbc4fa 100644 --- a/horde/login.php +++ b/horde/login.php @@ -262,7 +262,12 @@ if (!empty($conf['auth']['alternate_login'])) { $url = Horde_Util::addParameter($url, array(session_name() => session_id), null, false); } if (!empty($url_in)) { - $url = Horde_Util::addParameter($url, array('url' => _addAnchor($url_in, 'param', $url_anchor)), null, false); + $anchor = _addAnchor($url_in, 'param', $url_anchor); + if (strpos($url, '%25u')) { + $url = str_replace('%25u', $anchor, $url); + } else { + $url = Horde_Util::addParameter($url, array('url' => $anchor), null, false); + } } header('Location: ' . _addAnchor($url, 'url', $url_anchor)); exit; -- 2.11.0