diff --git a/bureau/admin/adm_login.php b/bureau/admin/adm_login.php index fd9e76dc..088f0a9f 100644 --- a/bureau/admin/adm_login.php +++ b/bureau/admin/adm_login.php @@ -58,6 +58,13 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) { exit(); } + if ($r['lastip'] != get_remote_ip() ) { + $error=_("Your IP is incorrect."); + include("index.php"); + exit(); + } + // FIXME we should add a peremption date on the cookie + // Ok, so we remove the cookie : setcookie('oldid','',0,'/'); unset($_COOKIE['oldid']); @@ -68,6 +75,7 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) { include("index.php"); exit(); } + include_once("adm_list.php"); exit(); } diff --git a/bureau/class/m_mem.php b/bureau/class/m_mem.php index 76386e13..cc20f314 100644 --- a/bureau/class/m_mem.php +++ b/bureau/class/m_mem.php @@ -119,6 +119,8 @@ class m_mem { } else $ip="''"; /* Close sessions that are more than 2 days old. */ $db->query("DELETE FROM sessions WHERE DATE_ADD(ts,INTERVAL 2 DAY)