From 5f7287c58a276d9df8b000fcdd8698956f86850c Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 17 Jul 2008 12:06:42 +0000 Subject: Fixes #164: Seems there is something erroniously setting 'guid' to something in logged in systems (or alternatively this is just a session problem on my system) either way I have modified isloggedin to check both guid and id... which seems to work. git-svn-id: https://code.elgg.org/elgg/trunk@1453 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/sessions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php index 320813289..2c84b2d1f 100644 --- a/engine/lib/sessions.php +++ b/engine/lib/sessions.php @@ -21,7 +21,8 @@ function isloggedin() { if (!is_installed()) return false; - if ((isset($_SESSION['guid'])) && ($_SESSION['guid'] > 0)) + if ((isset($_SESSION['guid'])) && ($_SESSION['guid'] > 0) && (isset($_SESSION['id'])) && ($_SESSION['id'] > 0) ) + return true; return false; @@ -139,7 +140,8 @@ if (!trigger_elgg_event('logout','user',$_SESSION['user'])) return false; $_SESSION['user']->code = ""; $_SESSION['user']->save(); - } + } + unset($_SESSION['username']); unset($_SESSION['name']); unset($_SESSION['code']); -- cgit v1.2.3