From 21cd55e54b82e6035a4468c07aebd49db0e5765e Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 6 Jul 2015 12:32:14 +0200 Subject: [PATCH] Improved the windows compatibility of some routes --- pandora_console/include/functions_config.php | 28 ++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 3a37a861e4..0c982d35f8 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -648,6 +648,11 @@ function config_process_config () { exit; } + $is_windows = false; + if (substr(strtolower(PHP_OS), 0, 3) === 'win') { + $is_windows = true; + } + /* Compatibility fix */ foreach ($configs as $c) { $config[$c['token']] = $c['value']; @@ -663,6 +668,15 @@ function config_process_config () { } } + if (!isset ($config['remote_config'])) { + if ($is_windows) + $default = 'C:\\PandoraFMS\\Pandora_Server\\data_in'; + else + $default = '/var/spool/pandora/data_in'; + + config_update_value ('remote_config', $default); + } + if (!isset ($config['date_format'])) { config_update_value ('date_format', 'F j, Y, g:i a'); } @@ -821,7 +835,12 @@ function config_process_config () { } if (!isset ($config["log_dir"])) { - config_update_value ('log_dir', '/var/spool/pandora/data_in/log'); + if ($is_windows) + $default = 'C:\\PandoraFMS\\Pandora_Server\\data_in\\log'; + else + $default = '/var/spool/pandora/data_in/log'; + + config_update_value ('log_dir', $default); } if (!isset ($config["log_max_lifetime"])) { @@ -963,7 +982,12 @@ function config_process_config () { } if (!isset ($config['netflow_path'])) { - config_update_value ( 'netflow_path', '/var/spool/pandora/data_in/netflow'); + if ($is_windows) + $default = 'C:\\PandoraFMS\\Pandora_Server\\data_in\\netflow'; + else + $default = '/var/spool/pandora/data_in/netflow'; + + config_update_value ( 'netflow_path', $default); } if (!isset ($config['netflow_interval'])) {