aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);