diff --git a/bureau/admin/adm_login.php b/bureau/admin/adm_login.php index b8614ae5..7439186c 100644 --- a/bureau/admin/adm_login.php +++ b/bureau/admin/adm_login.php @@ -29,6 +29,29 @@ */ require_once("../class/config.php"); +// If we just want to return to our previous session +$oldid=intval($_COOKIE['oldid']); +if ($oldid) { + setcookie('oldid','',0,'/admin/'); + + $db->query("select lastip from membres where uid='$oldid';"); + $db->next_record(); + if ($db->f("lastip") != getenv("REMOTE_ADDR") ) { + die('Error : bad IP address'); + } + + if (!$mem->setid($oldid)) + { + $oldid=null; + $error=$err->errstr(); + include("index.php"); + exit(); + } + $oldid=null; + include_once("main.php"); + exit(); +} + if (!$admin->enabled) { __("This page is restricted to authorized staff"); exit(); @@ -52,6 +75,7 @@ if (!$r=$admin->get($id)) } else { + setcookie('oldid',$cuid,0,'/admin/'); if (!$mem->setid($id)) { $error=$err->errstr(); diff --git a/bureau/admin/head.php b/bureau/admin/head.php index cdc425f2..8b697a3c 100644 --- a/bureau/admin/head.php +++ b/bureau/admin/head.php @@ -43,6 +43,14 @@ if (!$charset) $charset="iso-8859-1";
+ +$oldid=intval($_COOKIE['oldid']); +if ($oldid && $oldid!=$cuid) { + echo ""; + __("Invited session. Clic here to return to your previous session."); + echo "