2012-06-25 Miguel de Dios <miguel.dedios@artica.es>

* 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




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6697 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-06-25 13:17:05 +00:00
parent d82c06a212
commit 4591c80e22
7 changed files with 47 additions and 12 deletions

View File

@ -1,3 +1,17 @@
2012-06-25 Miguel de Dios <miguel.dedios@artica.es>
* 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 <slerena@artica.es> 2012-06-25 Sancho Lerena <slerena@artica.es>
* operation/menu.php: Changed order of treeview in menu. * operation/menu.php: Changed order of treeview in menu.

View File

@ -460,6 +460,18 @@ function checking_online_enterprise_package() {
$settings = um_db_load_settings(); $settings = um_db_load_settings();
$user_key = get_user_key($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 //Disabled output error messages
$package = @um_client_check_latest_update ($settings, $user_key); $package = @um_client_check_latest_update ($settings, $user_key);
//Get error message //Get error message

View File

@ -62,14 +62,16 @@ function get_user_key ($settings) {
echo __('Keygen file does not exists'); echo __('Keygen file does not exists');
echo '</h3>';*/ echo '</h3>';*/
return ''; return array('result' => false,
'message' => __('The Keygen is not in the path.'));
} }
if (! is_executable ($settings->keygen_path)) { if (! is_executable ($settings->keygen_path)) {
/*echo '<h3 class="error">'; /*echo '<h3 class="error">';
echo __('Keygen file is not executable'); echo __('Keygen file is not executable');
echo '</h3>';*/ echo '</h3>';*/
return ''; return array('result' => false,
'message' => __('Cannot execute the Keygen.'));
} }
$command_line = escapeshellcmd($settings->keygen_path. $command_line = escapeshellcmd($settings->keygen_path.

View File

@ -46,6 +46,11 @@ function main_view() {
false, "", false, $buttons); false, "", false, $buttons);
if (enterprise_installed()) { 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); main_view_enterprise($settings, $user_key);
} }
else { else {
@ -78,6 +83,11 @@ function main_view_enterprise($settings, $user_key) {
$settings = um_db_load_settings (); $settings = um_db_load_settings ();
$user_key = get_user_key ($settings); $user_key = get_user_key ($settings);
if (is_array($user_key)) {
if (!$user_key['result']) {
ui_print_error_message($user_key['message']);
}
}
} }
else { else {
ui_print_error_message(__('This is an Enterprise feature. Visit %s for more information.', '<a href="http://pandorafms.com">http://pandorafms.com</a>')); ui_print_error_message(__('This is an Enterprise feature. Visit %s for more information.', '<a href="http://pandorafms.com">http://pandorafms.com</a>'));

View File

@ -252,8 +252,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
if (!$projection){ if (!$projection){
$timestamp = $timestamp_short; $timestamp = $timestamp_short;
} }
// Data
// Data
if($show_events) { if($show_events) {
$chart[$timestamp]['event'] = $event_value; $chart[$timestamp]['event'] = $event_value;
$series_type['event'] = 'points'; $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['max'] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
$color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50); $color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50);
$color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10); $color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10);
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
$flash_chart = $config['flash_charts'];
$flash_chart = $config['flash_charts'];
if ($only_image) { if ($only_image) {
$flash_chart = false; $flash_chart = false;
} }
@ -2115,7 +2113,7 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $only_im
else { else {
$chart_time_format = 'M d H\h'; $chart_time_format = 'M d H\h';
} }
// Calculate source indexes // Calculate source indexes
$i = 0; $i = 0;
$sources = array (); $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['max'] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
$color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50); $color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50);
//$color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10); //$color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10);
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
$flash_chart = $config['flash_charts']; $flash_chart = $config['flash_charts'];
if ($only_image) { if ($only_image) {
$flash_chart = false; $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)); $dataset[$i]->addPoint($pivot, $y, array("x" => $x, "size" => $size, "value" => $count));
} }
} else { }
else {
// There's a problem when we have no data ... // There's a problem when we have no data ...
// This was the first try.. didnt work // This was the first try.. didnt work
//$dataset[$i]->addPoint($now, -1, array("x" => 0, "size" => 0)); //$dataset[$i]->addPoint($now, -1, array("x" => 0, "size" => 0));

View File

@ -2558,7 +2558,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table_resume->data[0][0] = '<span style="font: bold '.$sizem.'em Arial, Sans-serif; color: #000000;">'; $table_resume->data[0][0] = '<span style="font: bold '.$sizem.'em Arial, Sans-serif; color: #000000;">';
$table_resume->data[0][0] .= format_numeric($total_SLA / count($sla_showed), 2); $table_resume->data[0][0] .= format_numeric($total_SLA / count($sla_showed), 2);
$table_resume->data[0][0] .= "%</span>"; $table_resume->data[0][0] .= "%</span>";
$data[1] = html_print_table($table_resume, true); $data[1] = html_print_table($table_resume, true);
$table_resume = null; $table_resume = null;

View File

@ -683,7 +683,7 @@ function toggle_full_value(id) {
value_title = $("#hidden-value_replace_module_" + id).val(); value_title = $("#hidden-value_replace_module_" + id).val();
$("#hidden-value_replace_module_" + id).val($("#value_module_text_" + id).html()); $("#hidden-value_replace_module_" + id).val($("#value_module_text_" + id).html());
$("#value_module_text_" + id).html(value_title); $("#value_module_text_" + id).html(value_title);
} }
</script> </script>