From 3bb1fad3fe91b600fd8bdc8c2ec19751e36c11d7 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Fri, 18 Jan 2008 20:16:19 +0000 Subject: [PATCH] avoid unknow user --- include/class_user.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/class_user.php b/include/class_user.php index eb16ef5a2..703768d1a 100644 --- a/include/class_user.php +++ b/include/class_user.php @@ -40,7 +40,10 @@ class User { function User ($p_cn,$p_id=-1){ // if p_id is not set then check the connected user if ( $p_id == -1 ) { - echo_debug('class_user.php',__LINE__," g_user = ".$_SESSION['g_user']); + if ( ! isset ($_SESSION['g_user'])) + exit("Utilisateur inexistant"); + echo_debug('class_user.php',__LINE__," g_user = ".$_SESSION['g_user']); + $this->id=$_SESSION['g_user']; $this->pass=$_SESSION['g_pass']; $this->valid=(isset ($_SESSION['isValid']))?1:0;