From b297ec96e2fdb2925d3af9a1f0d431a9e6de055d Mon Sep 17 00:00:00 2001 From: Alexandre Anriot Date: Sun, 25 Sep 2005 22:25:08 +0000 Subject: [PATCH] =?UTF-8?q?la=20fonction=20clean=5Fip()=20ignore=20la=20pe?= =?UTF-8?q?rsonne=20concern=81=E9e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/includes/database.php | 5 +++-- htdocs/login.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/includes/database.php b/htdocs/includes/database.php index 3cf2f9a..1256a55 100644 --- a/htdocs/includes/database.php +++ b/htdocs/includes/database.php @@ -151,12 +151,13 @@ function update_ip($log, $ip) # nettoyage des ips de la base a la connexion -function clean_ip($ip) +function clean_ip($log, $ip) { $connexion = connexion(); $blank = "0.0.0.0"; - $query = 'update users set ip = \''.$blank.'\' where ip = \''.$ip.'\''; + $query = 'update users set ip = \''.$blank.'\' where ip = \''.$ip.'\' + and login != \''.$log.'\''; $resultat = mysql_query($query) or die("Erreur clean_ip: ".mysql_error()); mysql_close ($connexion); diff --git a/htdocs/login.php b/htdocs/login.php index 8365394..43e837d 100644 --- a/htdocs/login.php +++ b/htdocs/login.php @@ -62,7 +62,7 @@ header ('location: membre.php'); - clean_ip($ip); + clean_ip($_POST['login'],$ip); update_ip($_POST['login'], $ip); } ?>