From c963f94d27e2c1ebcb6220a18cdef17fec0c658a Mon Sep 17 00:00:00 2001 From: slerena Date: Wed, 10 Aug 2011 16:49:49 +0000 Subject: [PATCH] 2011-08-10 Sancho Lerena * pandoradb_data.sql: New sensor as agent type. Updated version. * include/graphs/functions_gd.php: Progressbar has a fixed font size. * include/functions_config.php: By default now gets a fontsize called "Smallfont"; ideal to be used with our graphs instead the other. Size is also smaller as default. * godmode/servers/manage_recontask.php: Fixed broken code (matching for NULL, now works). * godmode/servers/manage_recontask_form.php: Altered some default values to be better. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4710 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 16 ++++++++++++++ .../godmode/servers/manage_recontask.php | 21 ++++++++++++------- .../godmode/servers/manage_recontask_form.php | 6 +++--- pandora_console/include/functions_config.php | 2 +- .../include/graphs/functions_gd.php | 4 ++-- pandora_console/pandoradb_data.sql | 6 +++--- 6 files changed, 38 insertions(+), 17 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 954e8fdc34..bd7713a167 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,19 @@ +2011-08-10 Sancho Lerena + + * pandoradb_data.sql: New sensor as agent type. Updated version. + + * include/graphs/functions_gd.php: Progressbar has a fixed font size. + + * include/functions_config.php: By default now gets a fontsize + called "Smallfont"; ideal to be used with our graphs instead the + other. Size is also smaller as default. + + * godmode/servers/manage_recontask.php: Fixed broken code (matching + for NULL, now works). + + * godmode/servers/manage_recontask_form.php: Altered some default values + to be better. + 2011-08-10 Javier Lanz * operation/agentes/exportdata.php: Fixed an ugly spelling mistake diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index 4e4c601c61..a414fc943f 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -127,12 +127,13 @@ if (isset($_GET["update"])) { $where = array('id_rt' => $id); if ($name != "") { - if (($id_recon_script == 0) && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)) + if (($id_recon_script == 'NULL') && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)) $result = db_process_sql_update('trecon_task', $values, $where); - elseif ($id_recon_script != 0) + elseif ($id_recon_script != 'NULL') $result = db_process_sql_update('trecon_task', $values, $where); - else - $result = false; + else { + $result = false; + } } else $result = false; @@ -172,16 +173,19 @@ if (isset($_GET["create"])) { 'parent_recursion' => $parent_recursion ); + $reason = ""; if ($name != "") { - if (($id_recon_script == 0) && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)) + if (($id_recon_script == 'NULL') && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)) { $result = db_process_sql_insert('trecon_task', $values); + $reason = __("Network provided is not correct"); } - elseif ($id_recon_script != 0) { + elseif ($id_recon_script != 'NULL') { $result = db_process_sql_insert('trecon_task', $values); } - else + else { $result = false; + } } else $result = false; @@ -191,6 +195,7 @@ if (isset($_GET["create"])) { } else { echo '

'.__('Error creating recon task').'

'; + echo $reason; } } @@ -290,7 +295,7 @@ if ($result !== false) { echo '
'.__('There are no recon task configured').'
'; } -echo '
'; +echo '
'; echo '
'; echo html_print_submit_button (__('Create'),"crt",false,'class="sub next"',true); echo '
'; diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index f7324e4e99..21c9107b01 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -77,8 +77,8 @@ if (isset ($_GET["update"])) { // Edit mode $mode = "network_sweep"; $os_detect = 0; $resolve_names = 0; - $parent_detection = 0; - $parent_recursion = 1; + $parent_detection = 1; + $parent_recursion = 5; } // Headers @@ -214,7 +214,7 @@ $table->data[19][1] = html_print_checkbox ('parent_detection', 1, $parent_detec // Parent recursion $table->data[20][0] = "".__('Parent recursion'); -$table->data[20][1] = html_print_input_text ('parent_recursion', $parent_recursion, '', 1, 0, true); +$table->data[20][1] = html_print_input_text ('parent_recursion', $parent_recursion, '', 5, 0, true); // Different Form url if it's a create or if it's a update form echo '
'; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 839c9256e1..c9f283da96 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -437,7 +437,7 @@ function config_process_config () { } if (!isset ($config['fontpath'])) { - config_update_value ( 'fontpath', $config['homedir'].'/include/fonts/unicode.ttf'); + config_update_value ( 'fontpath', $config['homedir'].'/include/fonts/smallfont.ttf'); } if (!isset ($config['style'])) { diff --git a/pandora_console/include/graphs/functions_gd.php b/pandora_console/include/graphs/functions_gd.php index b4d59df312..4378a1c218 100755 --- a/pandora_console/include/graphs/functions_gd.php +++ b/pandora_console/include/graphs/functions_gd.php @@ -278,7 +278,7 @@ if ($mode == 0) { imagePng($imgPng); } else - drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, $fontsize); + drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, 6); break; case 2: if ($progress > 100 || $progress < 0) { @@ -290,7 +290,7 @@ if ($mode == 0) { imagePng($imgPng); } else - drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, $fontsize); + drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, 6); break; } } diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 04ede81ef8..2c231d4ea8 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -47,8 +47,8 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_compact','15'), ('graph_res','5'), ('step_compact','1'), -('db_scheme_version','4.0-dev'), -('db_scheme_build','PD110122'), +('db_scheme_version','4.0RC1'), +('db_scheme_build','PD110810'), ('show_unknown','0'), ('show_lastalerts','1'), ('style','pandora'), @@ -100,7 +100,7 @@ INSERT INTO `tconfig_os` VALUES (10,'Other','Other SO','so_other.png'), (11,'Network','Pandora FMS Network Agent','network.png'), (12,'Web Server','Web Server/Application','network.png'), -(13,'Octopods','Octopods Pandora FMS Hardware Agent','network.png'), +(13,'Sensor',' Pandora FMS Hardware Agent (Sensor)','network.png'), (14,'Embedded','Embedded device running a Pandora FMS agent','embedded.png'), (15,'Android','Android agent','android.png'); UNLOCK TABLES;