From 0542c42de4474ad20b1b762014a59af5b3b479be Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sat, 2 Jan 2010 17:47:06 +0000 Subject: [PATCH] fix git-svn-id: http://www.observium.org/svn/observer/trunk@586 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/authenticate.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/html/includes/authenticate.inc b/html/includes/authenticate.inc index cdf635761..8e6c037fb 100644 --- a/html/includes/authenticate.inc +++ b/html/includes/authenticate.inc @@ -4,16 +4,14 @@ session_start(); -if($_GET['logout']) { +if($_GET['logout'] && $_SESSION['authenticated']) { + mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('" . $_SESSION['username'] . "', '".$_SERVER["REMOTE_ADDR"]."', 'logged out')"); unset($_SESSION); session_destroy(); header('Location: /'); setcookie ("username", "", time() - 60*60*24*100, "/"); setcookie ("password", "", time() - 60*60*24*100, "/"); - mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('$olduser', '".$_SERVER["REMOTE_ADDR"]."', 'logged out')"); $auth_message = "Logged Out"; - unset ($_SESSION['authenticated']); - } if($_POST['username'] && $_POST['password']){