aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/sessions.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/sessions.php')
-rw-r--r--engine/lib/sessions.php10
1 files changed, 8 insertions, 2 deletions
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);