diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 89196031a9..9573f88042 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2012-06-25 Miguel de Dios + + * include/functions_graph.php, include/functions_reporting.php, + operation/agentes/status_monitor.php: cleaned source code style. + + * extensions/update_manager/load_updatemanager.php, + extensions/update_manager/lib/functions.ajax.php, + extensions/update_manager/main.php: now the function "get_key" + returns more info about error to get user key from execution of + keygen, and the calls of this function show more info about the + kind errors. + + Merged from 4.0.2 + 2012-06-25 Sancho Lerena * operation/menu.php: Changed order of treeview in menu. diff --git a/pandora_console/extensions/update_manager/lib/functions.ajax.php b/pandora_console/extensions/update_manager/lib/functions.ajax.php index 2af3e4e574..d93ae9d61a 100644 --- a/pandora_console/extensions/update_manager/lib/functions.ajax.php +++ b/pandora_console/extensions/update_manager/lib/functions.ajax.php @@ -460,6 +460,18 @@ function checking_online_enterprise_package() { $settings = um_db_load_settings(); $user_key = get_user_key($settings); + if (is_array($user_key)) { + if (!$user_key['result']) { + $return['text'] = ui_print_error_message( + array('message' => $user_key['message'], + 'no_close' => true), '', true); + + echo json_encode($return); + + return; + } + } + //Disabled output error messages $package = @um_client_check_latest_update ($settings, $user_key); //Get error message diff --git a/pandora_console/extensions/update_manager/load_updatemanager.php b/pandora_console/extensions/update_manager/load_updatemanager.php index 43f891d346..412a799b66 100644 --- a/pandora_console/extensions/update_manager/load_updatemanager.php +++ b/pandora_console/extensions/update_manager/load_updatemanager.php @@ -62,14 +62,16 @@ function get_user_key ($settings) { echo __('Keygen file does not exists'); echo '';*/ - return ''; + return array('result' => false, + 'message' => __('The Keygen is not in the path.')); } if (! is_executable ($settings->keygen_path)) { /*echo '

'; echo __('Keygen file is not executable'); echo '

';*/ - return ''; + return array('result' => false, + 'message' => __('Cannot execute the Keygen.')); } $command_line = escapeshellcmd($settings->keygen_path. diff --git a/pandora_console/extensions/update_manager/main.php b/pandora_console/extensions/update_manager/main.php index 37e444f8be..917ad83a55 100644 --- a/pandora_console/extensions/update_manager/main.php +++ b/pandora_console/extensions/update_manager/main.php @@ -46,6 +46,11 @@ function main_view() { false, "", false, $buttons); if (enterprise_installed()) { + if (is_array($user_key)) { + if (!$user_key['result']) { + ui_print_error_message($user_key['message']); + } + } main_view_enterprise($settings, $user_key); } else { @@ -78,6 +83,11 @@ function main_view_enterprise($settings, $user_key) { $settings = um_db_load_settings (); $user_key = get_user_key ($settings); + if (is_array($user_key)) { + if (!$user_key['result']) { + ui_print_error_message($user_key['message']); + } + } } else { ui_print_error_message(__('This is an Enterprise feature. Visit %s for more information.', 'http://pandorafms.com')); diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 1eb72b5ca9..0619df205e 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -252,8 +252,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, if (!$projection){ $timestamp = $timestamp_short; } - - // Data + // Data if($show_events) { $chart[$timestamp]['event'] = $event_value; $series_type['event'] = 'points'; @@ -2067,11 +2066,10 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events, $color['max'] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50); $color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50); $color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10); - ///////////////////////////////////////////////////////////////////////////////////////// - $flash_chart = $config['flash_charts']; + $flash_chart = $config['flash_charts']; if ($only_image) { $flash_chart = false; } @@ -2115,7 +2113,7 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $only_im else { $chart_time_format = 'M d H\h'; } - + // Calculate source indexes $i = 0; $sources = array (); @@ -2453,11 +2451,9 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events, $color['max'] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50); $color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50); //$color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10); - ///////////////////////////////////////////////////////////////////////////////////////// $flash_chart = $config['flash_charts']; - if ($only_image) { $flash_chart = false; } @@ -2668,7 +2664,8 @@ function grafico_modulo_log4x ($id_agente_modulo, $periodo, $show_event, // $dataset[$i]->addPoint($pivot, $y, array("x" => $x, "size" => $size, "value" => $count)); } - } else { + } + else { // There's a problem when we have no data ... // This was the first try.. didnt work //$dataset[$i]->addPoint($now, -1, array("x" => 0, "size" => 0)); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index e5bdc7377e..9ada8ba817 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2558,7 +2558,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $table_resume->data[0][0] = ''; $table_resume->data[0][0] .= format_numeric($total_SLA / count($sla_showed), 2); $table_resume->data[0][0] .= "%"; - + $data[1] = html_print_table($table_resume, true); $table_resume = null; diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 52e59b05a0..20d4a4359b 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -683,7 +683,7 @@ function toggle_full_value(id) { value_title = $("#hidden-value_replace_module_" + id).val(); $("#hidden-value_replace_module_" + id).val($("#value_module_text_" + id).html()); - + $("#value_module_text_" + id).html(value_title); }