From 318175b2dc8400dceaa177db6db3c7c95f66e974 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 17 Aug 2016 11:43:46 +0200 Subject: [PATCH 1/7] Fixed link to module library. Ticket #3953. --- .../extras/pandoradb_migrate_6.0_to_6.1.mysql.sql | 6 ++++++ .../extras/pandoradb_migrate_6.0_to_6.1.oracle.sql | 5 +++++ pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_console/pandoradb.data.postgreSQL.sql | 2 +- pandora_console/pandoradb_data.sql | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql index bb9d8ed229..80e1392325 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql @@ -46,3 +46,9 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '3 -- Table `tplanned_downtime_agents` -- --------------------------------------------------------------------- ALTER TABLE tplanned_downtime_agents ADD COLUMN `manually_disabled` tinyint(1) DEFAULT 0; + + +-- --------------------------------------------------------------------- +-- Table `tlink` +-- --------------------------------------------------------------------- +UPDATE `tlink` SET `link` = 'http://library.pandorafms.com/' WHERE `name` = 'Module library'; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql index f2f452f5b0..864622f91a 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql @@ -46,3 +46,8 @@ INSERT INTO tconfig (token, value) VALUES ('days_autodisable_deletion', '30'); -- Table `tplanned_downtime_agents` -- --------------------------------------------------------------------- ALTER TABLE tplanned_downtime_agents ADD COLUMN manually_disabled NUMBER(5, 0) DEFAULT 0; + +-- --------------------------------------------------------------------- +-- Table `tlink` +-- --------------------------------------------------------------------- +UPDATE tlink SET link = 'http://library.pandorafms.com/' WHERE name = 'Module library'; diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 370101d8ac..0cce5151c8 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -241,7 +241,7 @@ INSERT INTO tlink VALUES (1,'Pandora FMS Manual','http://wiki.pandorafms.com/?ti INSERT INTO tlink VALUES (2,'Pandora FMS','http://pandorafms.com'); INSERT INTO tlink VALUES (3,'Report a bug','{https://sourceforge.net/tracker/?func=add&group_id=155200&atid=794852}'); INSERT INTO tlink VALUES (4,'Suggest new feature','http://sourceforge.net/tracker/?group_id=155200&atid=794855'); -INSERT INTO tlink VALUES (5,'Module library','http://pandorafms.com/pandora/repository/en'); +INSERT INTO tlink VALUES (5,'Module library','http://library.pandorafms.com/'); -- Update curr val of sequence update_currval('tlink', 'id_link'); diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index 4880cec4a4..45aaa69078 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -209,7 +209,7 @@ INSERT INTO "tlink" VALUES (2,'Pandora FMS','http://pandorafms.com'), (3,'Report a bug','https://sourceforge.net/tracker/?func=add&group_id=155200&atid=794852'), (4,'Suggest new feature','http://sourceforge.net/tracker/?group_id=155200&atid=794855'), -(5,'Module library','http://pandorafms.com/pandora/repository/en'); +(5,'Module library','http://library.pandorafms.com/'); COMMIT WORK; SELECT setval('tlink_id_link_seq', (SELECT (SELECT MAX(id_link) FROM tlink))); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 41937c8199..5d505fb0ea 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -199,7 +199,7 @@ INSERT INTO `tlink` VALUES (2,'Pandora FMS','http://pandorafms.com'), (3,'Report a bug','https://sourceforge.net/tracker/?func=add&group_id=155200&atid=794852'), (4,'Suggest new feature','http://sourceforge.net/tracker/?group_id=155200&atid=794855'), -(5,'Module library','http://pandorafms.com/pandora/repository/en'); +(5,'Module library','http://library.pandorafms.com/'); UNLOCK TABLES; From d855f72f59643200eb0ca8be5991cd7e8b2c054d Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 17 Aug 2016 11:52:46 +0200 Subject: [PATCH 2/7] ticket integria: 3980 fixed error link recon_task IPAM #25 --- .../godmode/servers/manage_recontask.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index 3a6d29ea4e..be4f9c3348 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -270,6 +270,7 @@ if (isset($_GET["create"])) { // -------------------------------- //Pandora Admin must see all columns if (! check_acl ($config['id_user'], 0, "PM")) { + $sql = sprintf('SELECT * FROM trecon_task RT, tusuario_perfil UP WHERE @@ -309,11 +310,13 @@ if ($result !== false) { // Network recon task $data[2] = html_print_image ("images/network.png", true, array ("title" => __('Network recon task')))."  "; $data[2] .= network_profiles_get_name ($row["id_network_profile"]); + $mode_name = ''; } else { // APP recon task $data[2] = html_print_image ("images/plugin.png", true). "  "; - $data[2] .= db_get_sql (sprintf("SELECT name FROM trecon_script WHERE id_recon_script = %d", $row["id_recon_script"])); + $mode_name = db_get_sql (sprintf("SELECT name FROM trecon_script WHERE id_recon_script = %d", $row["id_recon_script"])); + $data[2] .= $mode_name; } @@ -355,8 +358,13 @@ if ($result !== false) { if (in_array($task_group, $user_groups_w)){ $data[8] = '' . html_print_image("images/eye.png", true) . ''; $data[8] .= '' . html_print_image("images/cross.png", true, array("border" => '0')) . ''; - $data[8] .= '' .html_print_image("images/config.png", true) . ''; - + if($mode_name != 'IPAM Recon'){ + $data[8] .= '' .html_print_image("images/config.png", true) . ''; + } else { + $sql_ipam = 'select id from tipam_network where id_recon_task =' . $row["id_rt"]; + $id_recon_ipam = db_get_sql($sql_ipam); + $data[8] .= '' . html_print_image("images/config.png", true) . ''; + } if($row["disabled"] == 0) { $data[8] .= '' .html_print_image("images/lightbulb.png", true) . ''; } From f3478168a7c08d34c84bac8f3333c3beebf6d9c6 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 17 Aug 2016 11:59:06 +0200 Subject: [PATCH 3/7] Fixed problems with search form in Policies form. Tiquet: #3246 --- .../godmode/agentes/module_manager.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index b935e26cc7..63cd751c2e 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -29,9 +29,17 @@ require_once ('include/functions_servers.php'); $search_string = io_safe_output(urldecode(trim(get_parameter ("search_string", "")))); +global $policy_page; + +if (!isset($policy_page)) + $policy_page = false; + // Search string filter form //echo '
'; -echo ''; +if (($policy_page) || (isset($agent))) + echo ''; +else + echo ''; echo ''; echo ""; echo ""; -//echo ''; +echo ''; // Check if there is at least one server of each type available to assign that // kind of modules. If not, do not show server type in combo @@ -92,11 +100,6 @@ if (strstr($sec2, "enterprise/godmode/policies/policies") !== false) { unset($modules['predictionserver']); } -global $policy_page; - -if (!isset($policy_page)) - $policy_page = false; - $show_creation = false; echo ""; From 8e7f2cdd90af74e42a20b8646831ab5853a6cbb1 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 17 Aug 2016 12:03:20 +0200 Subject: [PATCH 4/7] Delete html tag. Tiquet: #3246 --- pandora_console/godmode/agentes/module_manager.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 63cd751c2e..2a85b040c6 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -102,8 +102,6 @@ if (strstr($sec2, "enterprise/godmode/policies/policies") !== false) { $show_creation = false; -echo ""; - if (($policy_page) || (isset($agent))) { if ($policy_page) { $show_creation = true; From fb7d1894d45ebf27f7297b5108ec23936e28d2f0 Mon Sep 17 00:00:00 2001 From: axl89 Date: Wed, 17 Aug 2016 13:01:33 +0200 Subject: [PATCH 5/7] Modified create module test to adapt to new the changes --- tests/console/include/module_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/console/include/module_functions.py b/tests/console/include/module_functions.py index 0e4f989eaf..18ce221b1d 100644 --- a/tests/console/include/module_functions.py +++ b/tests/console/include/module_functions.py @@ -29,7 +29,7 @@ def create_network_server_module(driver,agent_name=None,module_name=None,compone driver.find_element_by_xpath('//ul[@class="mn"]/li/a/img[@data-title="Modules"]').click() Select(driver.find_element_by_id("moduletype")).select_by_visible_text("Create a new network server module") - driver.find_element_by_xpath('//*[@id="create_module_type"]/table/tbody/tr/td[5]/input').click() + driver.find_element_by_xpath('//*[@id="main"]/form/table/tbody/tr/td[5]/input').click() driver.find_element_by_xpath('//a[contains(.,"Advanced options")]').click() @@ -97,7 +97,7 @@ def create_data_server_module(driver,module_name,agent_name=None,type=None,min_w driver.find_element_by_xpath('//ul[@class="mn"]/li/a/img[@data-title="Modules"]').click() Select(driver.find_element_by_id("moduletype")).select_by_visible_text("Create a new data server module") - driver.find_element_by_xpath('//*[@id="create_module_type"]/table/tbody/tr/td[5]/input').click() + driver.find_element_by_xpath('//*[@id="main"]/form/table/tbody/tr/td[5]/input').click() driver.find_element_by_xpath('//a[contains(.,"Advanced options")]').click() From 0367f88f562ba2002fd4defb15e284b41b935230 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 17 Aug 2016 15:11:37 +0200 Subject: [PATCH 6/7] Fixed problems with form in recon task. GitHub #59 --- pandora_console/godmode/servers/manage_recontask_form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index f08cff8aea..be48d73164 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -248,7 +248,7 @@ $table->data[4][0] = "".__('Interval'); $table->data[4][0] .= ui_print_help_tip (__('Manual interval means that it will be executed only On-demand'), true); $values = array (0 => __('Defined'), 1 => __('Manual')); -$table->data[4][1] = html_print_select ($values, "interval_manual_defined", (int)($interval == 0), '','','',true); +$table->data[4][1] = html_print_select ($values, "interval_manual_defined", (int)($interval === 0), '','','',true); $table->data[4][1] .= ''; $table->data[4][1] .= html_print_extended_select_for_time ('interval' , $interval, '', '', '0', false, true, false, false); From 07234fa0879a640d2719b747d0150d3694aa7f1f Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 17 Aug 2016 15:41:59 +0200 Subject: [PATCH 7/7] Fixed problems in DB Status, in information of sql statements. GitHub: #57 --- pandora_console/extensions/db_status.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/extensions/db_status.php b/pandora_console/extensions/db_status.php index 2a7b802e9b..bda57705ae 100755 --- a/pandora_console/extensions/db_status.php +++ b/pandora_console/extensions/db_status.php @@ -277,7 +277,7 @@ function extension_db_check_tables_differences($connection_test, ui_print_info_message( __('You can execute this SQL query for to fix.') . "
" . '
' .
-										"ALTER TABLE " . $table . " MODIFY COLUMN " . $field . " " . $value . ";" .
+										"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $value . ";" .
 									'
' ); break; @@ -289,7 +289,7 @@ function extension_db_check_tables_differences($connection_test, ui_print_info_message( __('You can execute this SQL query for to fix.') . "
" . '
' .
-											"ALTER TABLE " . $table . " MODIFY COLUMN " . $field . "INT NULL;" .
+											"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . "INT NULL;" .
 										'
' ); } @@ -297,7 +297,7 @@ function extension_db_check_tables_differences($connection_test, ui_print_info_message( __('You can execute this SQL query for to fix.') . "
" . '
' .
-											"ALTER TABLE " . $table . " MODIFY COLUMN " . $field . "INT NOT NULL;" .
+											"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . "INT NOT NULL;" .
 										'
' ); }
"; echo __('Search') . ' ' . @@ -41,7 +49,7 @@ echo ""; html_print_submit_button (__('Filter'), 'filter', false, 'class="sub search"'); echo "