diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a683b879b1..3ab101b7c6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2013-04-25 Miguel de Dios + + * godmode/alerts/alert_list.list.php, + godmode/setup/setup_general.php, extensions/pandora_logs.php: some + fixes in the source code from the indications of bug in the tracker. + + Fixes: #3611333 + 2013-04-25 Miguel de Dios * extensions/agents_modules.php: changed the header of the table diff --git a/pandora_console/extensions/pandora_logs.php b/pandora_console/extensions/pandora_logs.php index 4c67c8033a..a2cd8ed975 100644 --- a/pandora_console/extensions/pandora_logs.php +++ b/pandora_console/extensions/pandora_logs.php @@ -17,13 +17,29 @@ function view_logfile ($file_name) { global $config; + $memory_limit = ini_get("memory_limit"); + if (strstr("M", $memory_limit) !== false) { + $memory_limit = str_replace("M", "", $memory_limit); + $memory_limit = $memory_limit * 1024 * 1024; + + //Arbitrary size for the PHP program + $memory_limit = $memory_limit - (8 * 1024 * 1024); + } + + + if (!file_exists($file_name)) { echo "

".__("Cannot find file"). "(".$file_name; echo ")

"; } else { $file_size = filesize($file_name); - if ($file_size > 512000) { + + if ($memory_limit < $file_size) { + echo "

$file_name (" . __("File is too large than PHP memory allocated in the system.") . ")

"; + echo "

" . __("The preview file is imposible.") . "

"; + } + else if ($file_size > 512000) { $data = file_get_contents ($file_name, false, NULL, $file_size - 512000); echo "

$file_name (".__("File is too large (> 500KB)").")

"; diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index d701a770e8..1215c888f9 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -41,7 +41,7 @@ else { } // Table for filter controls -$form_filter = '
'; +$form_filter = ''; $form_filter .= "\n"; $form_filter .= ''."\n"; $form_filter .= "\n"; diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 975da544af..a0e4d943e6 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -150,12 +150,14 @@ if ($config["integria_enabled"]) { continue; } $invexp = explode(',',$inv); - if (substr($invexp[1], 0, 1) == '"' - && substr($invexp[1], strlen($invexp[1])-1, 1) == '"') { - $invexp[1] = substr($invexp[1], 1, strlen($invexp[1])-2); + if (count($invexp) > 2) { + if (substr($invexp[1], 0, 1) == '"' + && substr($invexp[1], strlen($invexp[1])-1, 1) == '"') { + $invexp[1] = substr($invexp[1], 1, strlen($invexp[1])-2); + } + + $inventories[$invexp[0]] = $invexp[1]; } - - $inventories[$invexp[0]] = $invexp[1]; } } $table->data[22][0] = __('Integria inventory');