noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 05/07: Doc and audit


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 05/07: Doc and audit
Date: Thu, 23 Sep 2021 04:04:58 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit c07d16f54d6479b657b2111545bd0a346cf468c3
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Thu Sep 16 09:48:53 2021 +0200

    Doc and audit
---
 include/class/user.class.php | 10 ++++++++--
 include/config.inc.example   |  3 +++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/class/user.class.php b/include/class/user.class.php
index 45faa80..9dbf40d 100644
--- a/include/class/user.class.php
+++ b/include/class/user.class.php
@@ -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;
         }
 
diff --git a/include/config.inc.example b/include/config.inc.example
index 28eebcc..ea16393 100644
--- a/include/config.inc.example
+++ b/include/config.inc.example
@@ -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);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]