aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-02 11:44:41 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-02 11:44:41 +0000
commite12df0066de0a68c452a1cf9978352a602dcc84f (patch)
treee75a5d62c38186e2795062bee84359f2c41c53eb
parenta2e2d55bee987b5d3f4e8c5b4d64e699543093db (diff)
downloadelgg-e12df0066de0a68c452a1cf9978352a602dcc84f.tar.gz
elgg-e12df0066de0a68c452a1cf9978352a602dcc84f.tar.bz2
Fixes #3036 moved setting of forward url to before login in case session variables are being lost
git-svn-id: http://code.elgg.org/elgg/trunk@8567 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--actions/login.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/actions/login.php b/actions/login.php
index 1b4fbe1fd..5934d1423 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -6,6 +6,17 @@
* @subpackage User.Authentication
*/
+// set forward url
+if (isset($_SESSION['last_forward_from']) && $_SESSION['last_forward_from']) {
+ $forward_url = $_SESSION['last_forward_from'];
+ unset($_SESSION['last_forward_from']);
+} elseif (get_input('returntoreferer')) {
+ $forward_url = REFERER;
+} else {
+ // forward to main index page
+ $forward_url = '';
+}
+
$username = get_input('username');
$password = get_input("password");
$persistent = get_input("persistent", FALSE);
@@ -41,16 +52,5 @@ try {
forward(REFERER);
}
-// forward to correct page
-if (isset($_SESSION['last_forward_from']) && $_SESSION['last_forward_from']) {
- $forward_url = $_SESSION['last_forward_from'];
- unset($_SESSION['last_forward_from']);
-} elseif (get_input('returntoreferer')) {
- $forward_url = REFERER;
-} else {
- // forward to main index page
- $forward_url = '';
-}
-
system_message(elgg_echo('loginok'));
forward($forward_url);