From 35159c7a743b80e45561c49f83facea99a5c0fca Mon Sep 17 00:00:00 2001 From: Esteban Sanchez Date: Tue, 14 Apr 2009 12:59:55 +0000 Subject: [PATCH] 2009-04-14 Esteban Sanchez * operation/servers/view_server.php: Removed notice message when no servers were found. * reporting/fgraph.php: Use get_db_value_filter(). * include/styles/pandora.css: Updated copyright date. * include/styles/menu.css: Added policies enterprise style. * reporting/pChart/pChart.class: Fixed a infinite loop that happened sometimes on drawScale(). * include/config_process.php: Updated build version. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1619 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 20 +++++++++++++++++-- pandora_console/include/config_process.php | 2 +- pandora_console/include/styles/menu.css | 3 +++ pandora_console/include/styles/pandora.css | 2 +- .../operation/servers/view_server.php | 12 +++++------ pandora_console/reporting/fgraph.php | 16 +++++++-------- pandora_console/reporting/pChart/pChart.class | 4 ++-- 7 files changed, 39 insertions(+), 20 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d29d3d8531..9b24a20c8b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,7 +1,23 @@ +2009-04-14 Esteban Sanchez + + * operation/servers/view_server.php: Removed notice message when no + servers were found. + + * reporting/fgraph.php: Use get_db_value_filter(). + + * include/styles/pandora.css: Updated copyright date. + + * include/styles/menu.css: Added policies enterprise style. + + * reporting/pChart/pChart.class: Fixed a infinite loop that happened + sometimes on drawScale(). + + * include/config_process.php: Updated build version + 2009-04-13 Evi Vanoost - * include/htmlawed.php: HTML cleaner-upper. If compact_header is set will - actually strip the HTML for less bandwidth usage. + * include/htmlawed.php: HTML cleaner-upper. If compact_header is set + will actually strip the HTML for less bandwidth usage. * include/functions_ui.php: If compact_header is set, it will strip whitespace out of the included files diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d63609e1ab..e15ea15fd9 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //Pandora Version -$build_version = 'PC090402'; +$build_version = 'PC090414'; $pandora_version = 'v3.0-dev'; $config['start_time'] = microtime (true); diff --git a/pandora_console/include/styles/menu.css b/pandora_console/include/styles/menu.css index db41de802d..e518a977d4 100644 --- a/pandora_console/include/styles/menu.css +++ b/pandora_console/include/styles/menu.css @@ -156,6 +156,9 @@ #icon_god-setup { background: #E9F3D2 url(../../images/god7.png) no-repeat 4px 4px; } +#icon_god-policies { + background: #E9F3D2 url(../../images/policies.png) no-repeat 4px 4px; +} #icon_oper-inventory { background: #E9F3D2 url(../../images/page_white_text.png) no-repeat 4px 4px; } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 3c5b2273b6..5f67fae454 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -8,7 +8,7 @@ Description: The default Pandora FMS theme layout // ============================================= // Copyright (c) 2004-2008 Sancho Lerena, slerena@gmail.comnt // Copyright (c) 2004-2008 Raul Mateos Martin, raulofpandora@gmail.com -// Copyright (c) 2005-2008 Artica Soluciones Tecnologicas, info@artica.es +// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas, info@artica.es // Copyright (c) 2008-2009 Evi Vanoost, vanooste@rcbi.rochester.edu // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/pandora_console/operation/servers/view_server.php b/pandora_console/operation/servers/view_server.php index 7d71f6ad3d..1d3e83b773 100644 --- a/pandora_console/operation/servers/view_server.php +++ b/pandora_console/operation/servers/view_server.php @@ -36,7 +36,11 @@ echo "

".__('Pandora servers')." » ".__('Configuration detail')."

" $total_modules = (int) get_db_value ('COUNT(*)', 'tagente_modulo', 'disabled', 0); $servers = get_server_info (); - +if ($servers === false) { + echo "
".__('There are no servers configured into the database')."
"; + return; +} + $table->width = '98%'; $table->size = array (); $table->size[6] = '60'; @@ -81,9 +85,5 @@ foreach ($servers as $server) { array_push ($table->data, $data); } -if (! empty ($table->data)) { - print_table ($table); -} else { - echo "
".__('There are no servers configured into the database')."
"; -} +print_table ($table); ?> diff --git a/pandora_console/reporting/fgraph.php b/pandora_console/reporting/fgraph.php index bb0881bcf5..b098190ba6 100644 --- a/pandora_console/reporting/fgraph.php +++ b/pandora_console/reporting/fgraph.php @@ -430,7 +430,7 @@ function graphic_agentmodules ($id_agent, $width, $height) { function graphic_agentaccess ($id_agent, $width, $height, $period = 0) { global $config; - $data = array(); + $data = array (); $resolution = $config["graph_res"] * ($period * 2 / $width); // Number of "slices" we want in graph @@ -444,10 +444,11 @@ function graphic_agentaccess ($id_agent, $width, $height, $period = 0) { for ($i = 0; $i < $interval; $i++) { $bottom = $datelimit + ($periodtime * $i); $top = $datelimit + ($periodtime * ($i + 1)); - $data[$bottom] = (int) get_db_sql ("SELECT COUNT(*) FROM tagent_access WHERE - id_agent = ".$id_agent." AND - utimestamp > ".$bottom." AND - utimestamp < ".$top); + $data[$bottom] = (int) get_db_value_filter ('COUNT(*)', + 'tagent_access', + array ('id_agent' => $id_agent, + 'utimestamp > '.$bottom, + 'utimestamp < '.$top)); } $engine = get_graph_engine ($period); @@ -455,15 +456,14 @@ function graphic_agentaccess ($id_agent, $width, $height, $period = 0) { $engine->width = $width; $engine->height = $height; $engine->data = $data; - $engine->max_value = max ($data); + $engine->max_value = $engine->max_value = max ($data); $engine->show_title = false; $engine->fontpath = $config['fontpath']; $engine->xaxis_interval = floor ($width / 72); - $engine->yaxis_interval = max ($data); $engine->xaxis_format = 'date'; $engine->watermark = false; $engine->show_grid = false; - + $engine->single_graph (); } diff --git a/pandora_console/reporting/pChart/pChart.class b/pandora_console/reporting/pChart/pChart.class index 1571489a23..3584e15dc2 100644 --- a/pandora_console/reporting/pChart/pChart.class +++ b/pandora_console/reporting/pChart/pChart.class @@ -476,8 +476,8 @@ $Scale2 = ( $this->VMax - $this->VMin ) / $Factor / 2; $Scale4 = ( $this->VMax - $this->VMin ) / $Factor / 4; - if ( $Scale1 >= 1 && $Scale1 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = floor($Scale1); $Scale = 1;} - if ( $Scale2 >= 1 && $Scale2 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = floor($Scale2); $Scale = 2;} + if ($Scale1 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = max(floor($Scale1),1); $Scale = 1;} + if ($Scale2 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = max(floor($Scale2),1); $Scale = 2;} if (!$ScaleOk) { if ( $Scale2 > 1 ) { $Factor = $Factor * 10; }