2013-02-07 Miguel de Dios <miguel.dedios@artica.es>
* godmode/users/user_list.php, godmode/users/profile_list.php, godmode/users/configure_user.php, godmode/users/configure_profile.php, godmode/db/db_audit.php, include/functions_reporting.php: cleaned source code style. * include/functions_graph.php: fixed the default parameter $adapt_Key in the function "grafico_modulo_string". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7601 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
434d97c8f4
commit
809cd8407b
|
@ -1,3 +1,13 @@
|
|||
2013-02-07 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/users/user_list.php, godmode/users/profile_list.php,
|
||||
godmode/users/configure_user.php,
|
||||
godmode/users/configure_profile.php, godmode/db/db_audit.php,
|
||||
include/functions_reporting.php: cleaned source code style.
|
||||
|
||||
* include/functions_graph.php: fixed the default parameter
|
||||
$adapt_Key in the function "grafico_modulo_string".
|
||||
|
||||
2013-02-06 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_users.php
|
||||
|
|
|
@ -84,7 +84,7 @@ echo "<tr>";
|
|||
echo "<td class='datos2'><b>".__('First date')."</b></td>";
|
||||
echo "<td class='datos2'>".$result["first_date"]."</td></tr>";
|
||||
|
||||
echo "<tr><td class='datos'>";
|
||||
echo "<tr><td class='datos'>";
|
||||
echo "<b>".__('Latest date')."</b></td>";
|
||||
echo "<td class='datos'>".$result["latest_date"]."</td>";
|
||||
echo "</tr></table>";
|
||||
|
|
|
@ -49,8 +49,8 @@ if (!defined('METACONSOLE')) {
|
|||
}
|
||||
else {
|
||||
|
||||
user_meta_print_header();
|
||||
$sec2 = 'advanced';
|
||||
user_meta_print_header();
|
||||
$sec2 = 'advanced';
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@ else {
|
|||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile&pure='.$pure.'">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
ui_print_page_header (__('User detail editor'), "images/god3.png", false, "", true, $buttons);
|
||||
$sec = 'gusuarios';
|
||||
|
@ -202,7 +202,7 @@ if ($create_user) {
|
|||
$result = db_process_sql('/INSERT INTO tusuario (fullname, firstname, lastname, email, phone, comments, is_admin, language, id_skin, block_size, flash_chart, id_user, password, last_connect, registered) VALUES (\'' . $values['fullname'] . '\',\'\',\'\',\'\',\'\',\'\',' . $values['is_admin'] . ',\'' . $values['language'] .'\',' . $values['id_skin'] . ',' . $values['block_size'] . ',' . $values['flash_chart'] . ',\'' . $id . '\',\'' . $password_new . '\',0,\'' . get_system_time () . '\')');
|
||||
|
||||
if ($result) {
|
||||
$res = db_process_sql('/INSERT INTO tpassword_history (id_user, password, date_begin) VALUES (\'' . $id . '\',\'' . md5($password_new) . '\',\'' . date ("Y/m/d H:i:s", get_system_time()) . '\')');
|
||||
$res = db_process_sql('/INSERT INTO tpassword_history (id_user, password, date_begin) VALUES (\'' . $id . '\',\'' . md5($password_new) . '\',\'' . date ("Y/m/d H:i:s", get_system_time()) . '\')');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ if ($update_user) {
|
|||
if ($status != -1) {
|
||||
ui_print_result_message ($status,
|
||||
__('User info successfully updated'),
|
||||
__('Error updating user info (no change?)'));
|
||||
__('Error updating user info (no change?)'));
|
||||
}
|
||||
|
||||
if ($add_profile) {
|
||||
|
|
|
@ -48,7 +48,7 @@ if (!defined('METACONSOLE')) {
|
|||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
ui_print_page_header (__('User management').' » '.__('Profiles defined in Pandora'), "images/god3.png", false, "profile", true, $buttons);
|
||||
ui_print_page_header (__('User management').' » '.__('Profiles defined in Pandora'), "images/god3.png", false, "profile", true, $buttons);
|
||||
$sec = 'gusuarios';
|
||||
}
|
||||
else {
|
||||
|
@ -92,7 +92,7 @@ if($create_profile || $update_profile) {
|
|||
$incident_management = (bool) get_parameter ("incident_management");
|
||||
$agent_view = (bool) get_parameter ("agent_view");
|
||||
$agent_edit = (bool) get_parameter ("agent_edit");
|
||||
$alert_edit = (bool) get_parameter ("alert_edit");
|
||||
$alert_edit = (bool) get_parameter ("alert_edit");
|
||||
$user_management = (bool) get_parameter ("user_management");
|
||||
$db_management = (bool) get_parameter ("db_management");
|
||||
$alert_management = (bool) get_parameter ("alert_management");
|
||||
|
@ -248,7 +248,7 @@ foreach ($profiles as $profile) {
|
|||
$data[16] = ($profile["event_management"] ? $img : '');
|
||||
$data[17] = ($profile["pandora_management"] ? $img : '');
|
||||
$data[18] = '<a href="index.php?sec='.$sec.'&sec2=godmode/users/configure_profile&id='.$profile["id_perfil"].'&pure='.$pure.'"><b>'. html_print_image('images/config.png', true, array('title' => __('Edit'))) .'</b></a>';
|
||||
$data[18] .= ' <a href="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile["id_perfil"].'&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'. html_print_image("images/cross.png", true) . '</a>';
|
||||
$data[18] .= ' <a href="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile["id_perfil"].'&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'. html_print_image("images/cross.png", true) . '</a>';
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,9 +113,9 @@ else {
|
|||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile&pure='.$pure.'">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
ui_print_page_header (__('User management').' » '.__('Users defined in Pandora'), "images/god3.png", false, "", true, $buttons);
|
||||
|
||||
|
||||
ui_print_page_header (__('User management').' » '.__('Users defined in Pandora'), "images/god3.png", false, "", true, $buttons);
|
||||
|
||||
$sec = 'gusuarios';
|
||||
|
||||
}
|
||||
|
|
|
@ -2713,7 +2713,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||
}
|
||||
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
||||
$unit_name, $show_alerts, $avg_only, $date, '', '', $show_unknown);
|
||||
|
||||
|
||||
if ($compare === 'overlapped') {
|
||||
$i = 0;
|
||||
foreach($chart as $k=>$v) {
|
||||
|
@ -2730,26 +2730,26 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||
|
||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
||||
|
||||
|
||||
if ($compare === 'separated') {
|
||||
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,
|
||||
$long_index, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
||||
$water_mark,
|
||||
$config['fontpath'], $config['font_size'], $unit, 1, $series_type,
|
||||
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str).
|
||||
'<br>'.
|
||||
area_graph($flash_chart, $chart_prev, $width, $height/2, $color_prev, $legend_prev,
|
||||
$long_index_prev, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
||||
$water_mark,
|
||||
$config['fontpath'], $config['font_size'], $unit, 1, $series_type_prev,
|
||||
$chart_extra_data_prev, 0, 0, $adapt_key, false, $series_suffix_str);
|
||||
$long_index, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
||||
$water_mark,
|
||||
$config['fontpath'], $config['font_size'], $unit, 1, $series_type,
|
||||
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str).
|
||||
'<br>'.
|
||||
area_graph($flash_chart, $chart_prev, $width, $height/2, $color_prev, $legend_prev,
|
||||
$long_index_prev, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
||||
$water_mark,
|
||||
$config['fontpath'], $config['font_size'], $unit, 1, $series_type_prev,
|
||||
$chart_extra_data_prev, 0, 0, $adapt_key, false, $series_suffix_str);
|
||||
}
|
||||
else {
|
||||
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
||||
$long_index, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
||||
$water_mark,
|
||||
$config['fontpath'], $config['font_size'], $unit, 1, $series_type,
|
||||
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str);
|
||||
$long_index, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
||||
$water_mark,
|
||||
$config['fontpath'], $config['font_size'], $unit, 1, $series_type,
|
||||
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2956,11 +2956,11 @@ function graph_netflow_aggregate_pie ($data, $aggregate, $ttl = 1, $only_image =
|
|||
*/
|
||||
function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
||||
$width, $height , $title, $unit_name, $show_alerts, $avg_only = 0, $pure=0,
|
||||
$date = 0, $only_image = false, $homeurl = '', $adapt_key, $ttl = 1) {
|
||||
$date = 0, $only_image = false, $homeurl = '', $adapt_key = '', $ttl = 1) {
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
global $max_value;
|
||||
|
||||
|
||||
// Set variables
|
||||
if ($date == 0)
|
||||
$date = get_system_time();
|
||||
|
@ -3110,9 +3110,9 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
|||
|
||||
// Data in the interval
|
||||
//The order in chart array is very important!!!!
|
||||
$chart[$timestamp]['event'] = $event_value;
|
||||
$chart[$timestamp]['alert'] = $alert_value;
|
||||
$chart[$timestamp]['max'] = 0;
|
||||
$chart[$timestamp]['event'] = $event_value;
|
||||
$chart[$timestamp]['alert'] = $alert_value;
|
||||
$chart[$timestamp]['max'] = 0;
|
||||
|
||||
if ($count > 0) {
|
||||
$chart[$timestamp]['sum'] = $count;
|
||||
|
@ -3125,9 +3125,9 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
|||
|
||||
$chart[$timestamp]['min'] = 0;
|
||||
}
|
||||
|
||||
|
||||
$graph_stats = get_statwin_graph_statistics($chart);
|
||||
|
||||
|
||||
// Fix event and alert scale
|
||||
$event_max = 2 + (float)$max_value * 1.05;
|
||||
foreach ($chart as $timestamp => $chart_data) {
|
||||
|
@ -3176,9 +3176,9 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
|||
$legend['alert'] = __('Alerts');
|
||||
}
|
||||
|
||||
$legend['max'] = __('Max').': '.__('Last').': '.$graph_stats['max']['last'].' '.$unit.' ; '.__('Avg').': '.$graph_stats['max']['avg'].' '.$unit.' ; '.__('Max').': '.$graph_stats['max']['max'].' '.$unit.' ; '.__('Min').': '.$graph_stats['max']['min'].' '.$unit;
|
||||
$legend['max'] = __('Max').': '.__('Last').': '.$graph_stats['max']['last'].' '.$unit.' ; '.__('Avg').': '.$graph_stats['max']['avg'].' '.$unit.' ; '.__('Max').': '.$graph_stats['max']['max'].' '.$unit.' ; '.__('Min').': '.$graph_stats['max']['min'].' '.$unit;
|
||||
$legend['sum'] = __('Data').': '.__('Last').': '.$graph_stats['sum']['last'].' '.$unit.' ; '.__('Avg').': '.$graph_stats['sum']['avg'].' '.$unit.' ; '.__('Max').': '.$graph_stats['sum']['max'].' '.$unit.' ; '.__('Min').': '.$graph_stats['sum']['min'].' '.$unit;
|
||||
$legend['min'] = __('Min').': '.__('Last').': '.$graph_stats['min']['last'].' '.$unit.' ; '.__('Avg').': '.$graph_stats['min']['avg'].' '.$unit.' ; '.__('Max').': '.$graph_stats['min']['max'].' '.$unit.' ; '.__('Min').': '.$graph_stats['min']['min'].' '.$unit;
|
||||
$legend['min'] = __('Min').': '.__('Last').': '.$graph_stats['min']['last'].' '.$unit.' ; '.__('Avg').': '.$graph_stats['min']['avg'].' '.$unit.' ; '.__('Max').': '.$graph_stats['min']['max'].' '.$unit.' ; '.__('Min').': '.$graph_stats['min']['min'].' '.$unit;
|
||||
|
||||
|
||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||
|
@ -3335,8 +3335,8 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu
|
|||
|
||||
///Functions for the LOG4X graphs
|
||||
function grafico_modulo_log4x ($id_agente_modulo, $periodo, $show_event,
|
||||
$width, $height , $title, $unit_name, $show_alert, $avg_only = 0, $pure=0,
|
||||
$date = 0) {
|
||||
$width, $height , $title, $unit_name, $show_alert, $avg_only = 0, $pure=0,
|
||||
$date = 0) {
|
||||
|
||||
grafico_modulo_log4x_trace("<pre style='text-align:left;'>");
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ function reporting_get_agentmodule_data_average ($id_agent_module, $period, $dat
|
|||
// Initialize variables
|
||||
if (empty ($date)) $date = get_system_time ();
|
||||
if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"];
|
||||
$datelimit = $date - $period;
|
||||
$datelimit = $date - $period;
|
||||
|
||||
$id_module_type = modules_get_agentmodule_type ($id_agent_module);
|
||||
$module_type = modules_get_moduletype_name ($id_module_type);
|
||||
|
|
Loading…
Reference in New Issue