From 4aec2e65d1167442c416887727a61110ac5b11df Mon Sep 17 00:00:00 2001 From: ramonn Date: Fri, 22 Mar 2013 13:23:26 +0000 Subject: [PATCH] 2013-03-22 Ramon Novoa * include/functions_db.php: Always display the source ip address when calling db_pandora_audit. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/config_process.php | 2 +- pandora_console/include/functions_db.php | 17 ++++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 83ba851474..f80d4dc3a8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-03-22 Ramon Novoa + + * include/functions_db.php: Always display the source ip address + when calling db_pandora_audit. + 2013-03-22 Mario Pulido * godmode/alerts/configure_alert_template.php, diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 0150f3df58..781852eaef 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -33,7 +33,7 @@ if (empty($script_tz)){ global $develop_bypass; /* Help to debug problems. Override global PHP configuration */ -if (!isset($develop_bypass)) $develop_bypass = 0; +$develop_bypass = 0; if ($develop_bypass != 1) { // error_reporting(E_ALL); diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 576b4f5e9e..748ece5995 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -121,17 +121,16 @@ function db_escape_string_sql($string) { function db_pandora_audit($accion, $descripcion, $user_id = false, $ip = true, $info = '') { global $config; - if ($ip !== false) { - if (isset($config["remote_addr"])) { - $ip = $config["remote_addr"]; + // Ignore $ip and always set the ip address + if (isset($config["remote_addr"])) { + $ip = $config["remote_addr"]; + } + else { + if ($_SERVER['REMOTE_ADDR']) { + $ip = $_SERVER['REMOTE_ADDR']; } else { - if ($_SERVER['REMOTE_ADDR']) { - $ip = $_SERVER['REMOTE_ADDR']; - } - else { - $ip = null; - } + $ip = __('N/A'); } }