mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
check for HTTP_X_FORWARDED_FOR in add_log_line()
use it instead of REMOTE_ADDR
This commit is contained in:
parent
fdd369f8ec
commit
06347ff212
|
@ -322,10 +322,14 @@ function add_log_line($msg="", $priority=null) { /* {{{ */
|
|||
|
||||
if(!$logger) return;
|
||||
|
||||
if($user)
|
||||
$logger->log($user->getLogin()." (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg, $priority);
|
||||
if(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
else
|
||||
$logger->log("-- (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg, $priority);
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
if($user)
|
||||
$logger->log($user->getLogin()." (".$ip.") ".basename($_SERVER["REQUEST_URI"], ".php").$msg, $priority);
|
||||
else
|
||||
$logger->log("-- (".$ip.") ".basename($_SERVER["REQUEST_URI"], ".php").$msg, $priority);
|
||||
} /* }}} */
|
||||
|
||||
function _add_log_line($msg="") { /* {{{ */
|
||||
|
|
Loading…
Reference in New Issue
Block a user