From d75e0dc8699df3e79152d2df7c619ae0c3ede998 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Mon, 18 Jun 2012 11:22:13 +0000 Subject: [PATCH] 2012-06-18 Juan Manuel Ramon * include/functions_html.php godmode/agentes/module_manager_editor_common.php: Modified width of module type select in module editor when you are editing/creating a network module. * include/functions.php godmode/reporting/visual_console_builder.php: Fixed autorefresh functionality. * include/functions_ui.php godmode/massive/massive_edit_modules.php operation/agentes/ver_agente.php: Several Php warnings fixed over console code. * godmode/reporting/reporting_builder.list_items.php: Fixed broken view due to a bad sintax statement. Merged fro branches. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6568 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 21 +++++++++++++++++++ .../agentes/module_manager_editor_common.php | 2 +- .../godmode/massive/massive_edit_modules.php | 5 +++-- .../reporting_builder.list_items.php | 2 +- .../reporting/visual_console_builder.php | 7 ++++++- pandora_console/include/functions.php | 8 ++++--- pandora_console/include/functions_html.php | 5 +++-- pandora_console/include/functions_ui.php | 9 +------- .../operation/agentes/networkmap.php | 3 +++ .../operation/agentes/ver_agente.php | 3 +++ 10 files changed, 47 insertions(+), 18 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ee921fd7f6..f3b6b78baf 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,24 @@ +2012-06-18 Juan Manuel Ramon + + * include/functions_html.php + godmode/agentes/module_manager_editor_common.php: Modified width + of module type select in module editor when you are + editing/creating a network module. + + * include/functions.php + godmode/reporting/visual_console_builder.php: Fixed autorefresh + functionality. + + * include/functions_ui.php + godmode/massive/massive_edit_modules.php + operation/agentes/ver_agente.php: Several Php warnings + fixed over console code. + + * godmode/reporting/reporting_builder.list_items.php: Fixed broken + view due to a bad sintax statement. + + Merged fro branches. + 2012-06-18 Sergio Martin * include/functions_config.php: Cleaning the mess when diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index b947c6b314..8824bc213e 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -175,7 +175,7 @@ else { ORDER BY descripcion', implode (',', $categories)); $table_simple->data[1][1] = html_print_select_from_sql ($sql, 'id_module_type', - $idModuleType, '', '', '', true, false, false, $disabledBecauseInPolicy); + $idModuleType, '', '', '', true, false, false, $disabledBecauseInPolicy, false, false, 100); } $table_simple->data[1][2] = __('Module group'); diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 1d0b7bc49d..db48dd710f 100644 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -106,7 +106,7 @@ $idAgentMassive = (int) get_parameter('id_agent_massive'); $group_select = get_parameter('groups_select'); $module_name = get_parameter ('module_name'); -$agents_select = get_parameter('agents'); +$agents_select = get_parameter('agents', array()); $agents_id = get_parameter('id_agents'); $modules_select = get_parameter('module'); $selection_mode = get_parameter('selection_mode', 'modules'); @@ -114,7 +114,8 @@ $recursion = get_parameter('recursion'); $update = (bool) get_parameter_post ('update'); -if ($update) { +if ($update) { + $agents_ = ''; if($selection_mode == 'modules') { $force = get_parameter('force_type', false); diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index 33db797fb0..b8839fcf43 100644 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -295,7 +295,7 @@ foreach ($items as $item) { $row [3] = ''; } else { - $module_name_db = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])) + $module_name_db = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); $row[3] = ui_print_truncate_text(io_safe_output($module_name_db), 'module_small'); } } diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index c717b03c57..3c2e0c5a32 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -254,6 +254,11 @@ switch ($activeTab) { break; } +if (isset($config['vc_refr']) and $config['vc_refr'] != 0) + $view_refresh = $config['vc_refr']; +else + $view_refresh = '60'; + $buttons = array( 'data' => array('active' => false, 'text' => '' . @@ -268,7 +273,7 @@ $buttons = array( 'text' => '' . html_print_image ("images/config.png", true, array ("title" => __('Editor'))) .''), 'view' => array('active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/eye.png", true, array ("title" => __('View'))) .''),); if ($action == 'new' || $idVisualConsole === false){ diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 2f4ee4c321..7a7de0a362 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -32,9 +32,11 @@ function check_refererer() { if (isset($_SERVER['HTTP_REFERER'])) { $referer = $_SERVER['HTTP_REFERER']; } - else if (isset($_GET['HTTP_REFERER'])) { - $referer = $_GET['HTTP_REFERER']; - } + + // If refresh is performed then dont't check referer + // This is done due to problems with HTTP_REFERER var when metarefresh is performed + if ($config["refr"] > 0) + return true; $url = 'http://'; if ($config['https']) { diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 3e6474ec2a..93f8880881 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -390,11 +390,12 @@ function html_print_select ($fields, $name, $selected = '', $script = '', $nothi * @param bool $disabled if it's true, disable the select. * @param string $style The string of style. * @param mixed $size Max elements showed in select or default (size=10) + * @param int $truncante_size Truncate size of the element, by default is set to GENERIC_SIZE_TEXT constant * * @return string HTML code if return parameter is true. */ function html_print_select_from_sql ($sql, $name, $selected = '', $script = '', $nothing = '', $nothing_value = '0', $return = false, - $multiple = false, $sort = true, $disabled = false, $style = false, $size = false) { + $multiple = false, $sort = true, $disabled = false, $style = false, $size = false, $trucate_size = GENERIC_SIZE_TEXT) { global $config; $fields = array (); @@ -405,7 +406,7 @@ function html_print_select_from_sql ($sql, $name, $selected = '', $script = '', foreach ($result as $row) { $id = array_shift($row); $value = array_shift($row); - $fields[$id] = ui_print_truncate_text($value, GENERIC_SIZE_TEXT, false, true, false); + $fields[$id] = ui_print_truncate_text($value, $trucate_size, false, true, false); } return html_print_select ($fields, $name, $selected, $script, $nothing, $nothing_value, $return, $multiple, $sort,'',$disabled, $style,'', $size); diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 261c5c8f12..673542d3a6 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1057,15 +1057,8 @@ function ui_process_page_head ($string, $bitfield) { if ($config["refr"] > 0) { $query = ui_get_url_refresh (false); - - - $HTTP_REFERER = ''; - if (isset($_SERVER['HTTP_REFERER'])) - $HTTP_REFERER = '&HTTP_REFERER=' . $_SERVER['HTTP_REFERER']; - else if (isset($_GET['HTTP_REFERER'])) - $HTTP_REFERER = '&HTTP_REFERER=' . $_GET['HTTP_REFERER']; - $output .= ''; + $output .= ''; } $output .= "\n\t"; $output .= 'Pandora FMS - '.__('the Flexible Monitoring System').' diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index 5a56cdc5f5..88ecc5dbee 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -44,6 +44,8 @@ if($delete_networkmap) { $message = ui_print_result_message ($result, __('Network map deleted successfully'), __('Could not delete network map'), '', true); + + echo $message; $id_networkmap = 0; } @@ -220,6 +222,7 @@ if(!$nomaps && $id_networkmap != 0) { html_print_image("images/file.png", true, array ("title" => __('Save map'))) .''); } +$title = ''; switch($activeTab){ case 'topology': $title = __('Topology view'); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 872dd53444..3b1a69a5a3 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -111,6 +111,9 @@ if (is_ajax ()) { $nameAgents = db_get_all_rows_sql($sql); + if ($nameAgents == false) + $nameAgents = array(); + foreach ($nameAgents as $nameAgent) { $names[] = $nameAgent['name']; }