Skip to content
Permalink
Browse files Browse the repository at this point in the history
FIX 2.4 protect login/logout logs recording
  • Loading branch information
root committed Jun 16, 2020
1 parent dddab9f commit c416b52
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/function.php
Expand Up @@ -370,10 +370,13 @@ function stripAccents($str, $charset='utf-8'){
function logging($module,$command,$user=false){
global $database_eonweb;
global $dateformat;
if($user)
if($user){
$user = htmlspecialchars($user);
sqlrequest($database_eonweb,"insert into logs values ('','".time()."','$user','$module','$command','".$_SERVER["REMOTE_ADDR"]."');");
elseif(isset($_COOKIE['user_name']))
sqlrequest($database_eonweb,"insert into logs values ('','".time()."','".$_COOKIE['user_name']."','$module','$command','".$_SERVER["REMOTE_ADDR"]."');");
}elseif(isset($_COOKIE['user_name'])){
$user = htmlspecialchars($_COOKIE['user_name']);
sqlrequest($database_eonweb,"insert into logs values ('','".time()."','".$user."','$module','$command','".$_SERVER["REMOTE_ADDR"]."');");
}
}

// Time
Expand Down

0 comments on commit c416b52

Please sign in to comment.