From 9c3b166db634130111c7a6712a7935a0872359fe Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 5 Aug 2008 20:28:41 +0000 Subject: Tweaked the way forwarding works. git-svn-id: https://code.elgg.org/elgg/trunk@1721 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 1 - engine/lib/sessions.php | 10 ++++++++-- 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); -- cgit v1.2.3