Fixed request #15.

This commit is contained in:
Rooty 2020-12-11 06:15:15 +01:00
parent 47a80aa1c5
commit d11638fcc9

View File

@ -568,12 +568,19 @@ var $currentCoordinationObject=null;
}
}else{
/* Tentative de connexion */
$clientIp=isset($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
if ($GLOBALS["SYSTEM_USER_SESSION"]->isNew==true)
{
$clientIp=isset($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
// $message="log:".$login.",".date("Y-m-d H:i:s").",uid:".$GLOBALS["SYSTEM_USER_SESSION"]->user->getId().",eid:".$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId.",nid:".$GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId.",0";
$message="auth-failed: ".date("Y-m-d H:i:s")." Authentication attempt with user ".$login." from ".$clientIp.". Session is uid:".$GLOBALS["SYSTEM_USER_SESSION"]->user->getId();
addToLog( $message, $CONF_MESSAGE_FILE );
} else {
$file= $CONF_AUTH_FILE;
if (isset($HTTP_REFERER))
if (strpos($HTTP_REFERER, $SERVER_NAME)===false)
$file= $CONF_AUTH_ALIEN_FILE;
$message="auth-failed: ".date("Y-m-d H:i:s")." Authentication attempt with user ".$login." from ".$clientIp.". Session is uid:".$GLOBALS["SYSTEM_USER_SESSION"]->user->getId();
addToLog( $message, $file );
}
// if(file_exists("/usr/local/sbin/xmpp_notification.py"))
if(file_exists("/usr/local/sbin/matrix_notification.py"))