diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 9f4c38aa68..0f552ac519 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -104,6 +104,7 @@ function config_update_value($token, $value, $noticed=false, $password=false) return true; } + $prev_value = $config[$token]; $config[$token] = $value; $value = io_safe_output($value); @@ -117,13 +118,24 @@ function config_update_value($token, $value, $noticed=false, $password=false) return true; } else { // Something in setup changes. - if ($noticed === true) { + $value_token = (empty($config[$token]) === true) ? 0 : $config[$token]; + $prev_value = (empty($prev_value) === true) ? 0 : $prev_value; + if (is_array($prev_value) === true) { + $prev_value = implode(';', $prev_value); + } + + if ($noticed === true && $prev_value !== $value_token) { db_pandora_audit( AUDIT_LOG_SETUP, 'Setup has changed', false, false, - sprintf('Token << %s >> updated.', $token) + sprintf( + 'Token << %s >> updated %s -> %s', + $token, + $prev_value, + $value_token + ) ); } @@ -2090,11 +2102,6 @@ function config_update_config() } else { $config['error_config_update_config'] = []; $config['error_config_update_config']['correct'] = true; - - db_pandora_audit( - AUDIT_LOG_SETUP, - 'Setup has changed' - ); } if (count($errors) > 0) {