aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-05 20:28:41 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-05 20:28:41 +0000
commit9c3b166db634130111c7a6712a7935a0872359fe (patch)
treea95331be41924bf6709ab3a5fb837fab2903e322
parent8422a0502f87ff85c0898287a3578cf387965586 (diff)
downloadelgg-9c3b166db634130111c7a6712a7935a0872359fe.tar.gz
elgg-9c3b166db634130111c7a6712a7935a0872359fe.tar.bz2
Tweaked the way forwarding works.
git-svn-id: https://code.elgg.org/elgg/trunk@1721 36083f99-b078-4883-b0ff-0f9b5a30f544
-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);