diff options
-rw-r--r-- | actions/login.php | 9 | ||||
-rw-r--r-- | engine/lib/elgglib.php | 17 |
2 files changed, 19 insertions, 7 deletions
diff --git a/actions/login.php b/actions/login.php index 4d4f3c098..95c90ce7e 100644 --- a/actions/login.php +++ b/actions/login.php @@ -29,7 +29,14 @@ if ($result) {
system_message(elgg_echo('loginok'));
- forward("pg/dashboard/");
+ if ($_SESSION['last_forward_from']) + { + $forward_url = $_SESSION['last_forward_from']; + $_SESSION['last_forward_from'] = ""; + forward($forward_url); + } + else + forward("pg/dashboard/");
} else {
register_error(elgg_echo('loginerror'));
}
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 1bd9843f6..e2a599511 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -25,13 +25,18 @@ */
function forward($location = "") {
-
- if (!headers_sent()) {
+ global $CONFIG;
+ if (!headers_sent()) { + + $_SESSION['last_forward_from'] = current_page_url(); +
$_SESSION['messages'] = system_messages();
- if (substr_count($location, 'http://') == 0) {
- global $CONFIG;
+ if (substr_count($location, 'http://') == 0) { +
$location = $CONFIG->url . $location;
- }
+ } + +
header("Location: {$location}");
exit;
}
@@ -56,7 +61,7 @@ if (($url['user']) || $url['pass']) $page .="@"; $page .= $url['host']; - $page = trim($page, "/"); $page.="/"; + $page = trim($page, "/"); //$page.="/"; $page .= $_SERVER['REQUEST_URI']; |