Doc and audit

This commit is contained in:
sparkyx 2021-09-16 09:48:53 +02:00
parent 3a59e434dd
commit c07d16f54d
2 changed files with 11 additions and 2 deletions

View file

@ -108,7 +108,11 @@ class User
if ($this->load()==-1)
{
echo '<h2 class="error">'._('Utilisateur ou mot de passe incorrect').'</h2>';
$sql="insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
$this->db->exec_sql($sql,
array($_SESSION[SESSION_KEY.'g_user'], $_SERVER["REMOTE_ADDR"], "DISCON",
$_SERVER['REQUEST_URI'], 'FAIL'));
$this->clean_session();
redirect('logout.php', 1);
exit();
}
@ -440,10 +444,12 @@ class User
}
else
{
if ($from=='LOGIN')
if ($from=='LOGIN' || $from=='PORTAL')
{
$cn->exec_sql($sql,
array($_SESSION[SESSION_KEY.'g_user'], $_SERVER["REMOTE_ADDR"], $from,
$_SERVER['REQUEST_URI'], 'SUCCESS'));
}
$this->valid=1;
}

View file

@ -83,3 +83,6 @@ define ("DEBUGNOALYSS",0);
// define ("MAX_FILE_SIZE",2097152);
// Create your own SESSION_KEY
// define ("SESSION_KEY","irazap492pq11");
//
// Audit everything
// define ("AUDIT_ENABLE",true);