aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/elgglib.php1
-rw-r--r--engine/lib/sessions.php10
2 files changed, 8 insertions, 3 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index a4302676f..12f9910f3 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -30,7 +30,6 @@
$current_page = current_page_url();
if (strpos($current_page, $CONFIG->wwwroot . "action") ===false)
- $_SESSION['last_forward_from'] = current_page_url();
$_SESSION['messages'] = system_messages();
if (substr_count($location, 'http://') == 0) {
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php
index 279beb107..87e2f931d 100644
--- a/engine/lib/sessions.php
+++ b/engine/lib/sessions.php
@@ -229,7 +229,10 @@
*
*/
function gatekeeper() {
- if (!isloggedin()) forward();
+ if (!isloggedin()) {
+ $_SESSION['last_forward_from'] = current_page_url();
+ forward();
+ }
}
/**
@@ -239,7 +242,10 @@
function admin_gatekeeper()
{
gatekeeper();
- if (!$_SESSION['user']->admin && !$_SESSION['user']->siteadmin) forward();
+ if (!$_SESSION['user']->admin && !$_SESSION['user']->siteadmin) {
+ $_SESSION['last_forward_from'] = current_page_url();
+ forward();
+ }
}
register_elgg_event_handler("boot","system","session_init",1);