From 43364e3310b25d2540ff2c5d6dc0a13e013030d3 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 25 Aug 2011 18:52:35 +0000 Subject: [PATCH] 2011-08-25 Miguel de Dios * extensions/update_manager.php: check if the field "update_server_path" in the table is the last path for Pandora v4 and update. * extensions/update_manager/main.php: rewrite the text to message for show only Pandora FMS instead the Pandora FMS vX. *extensions/update_manager/sql/update_manager.sql, extensions/update_manager/sql/update_manager.postgreSQL.sql, extensions/update_manager/sql/update_manager.oracle.sql: update the "update_server_path" to Pandora v4. Fixes: #3394754 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4827 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 17 ++++++++++++++++- pandora_console/extensions/update_manager.php | 15 ++++++++++++++- .../extensions/update_manager/main.php | 4 ++-- .../sql/update_manager.oracle.sql | 2 +- .../sql/update_manager.postgreSQL.sql | 2 +- .../update_manager/sql/update_manager.sql | 2 +- 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3f993666d7..4e10510744 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,6 +1,21 @@ 2011-08-25 Miguel de Dios - * ggodmode/modules/manage_network_templates.php, + * extensions/update_manager.php: check if the field "update_server_path" in + the table is the last path for Pandora v4 and update. + + * extensions/update_manager/main.php: rewrite the text to message for show + only Pandora FMS instead the Pandora FMS vX. + + *extensions/update_manager/sql/update_manager.sql, + extensions/update_manager/sql/update_manager.postgreSQL.sql, + extensions/update_manager/sql/update_manager.oracle.sql: update the + "update_server_path" to Pandora v4. + + Fixes: #3394754 + +2011-08-25 Miguel de Dios + + * godmode/modules/manage_network_templates.php, godmode/modules/manage_network_components.php, godmode/modules/manage_nc_groups.php: added checkboxes in the elements in the list and main checkbox to select all checkboxes, for to multiple delete. diff --git a/pandora_console/extensions/update_manager.php b/pandora_console/extensions/update_manager.php index e3cd265243..bc5d3e3d96 100644 --- a/pandora_console/extensions/update_manager.php +++ b/pandora_console/extensions/update_manager.php @@ -33,9 +33,22 @@ function update_settings_database_connection () { function pandora_update_manager_install () { global $config; - if (isset ($config['update_manager_installed'])) + if (isset ($config['update_manager_installed'])) { + $update_server_path = db_get_value('value', 'tupdate_settings', '`key`', 'update_server_path'); + + if ($update_server_path != '/pandoraupdate4/server.php') { + $result = db_process_sql_update('tupdate_settings', + array('value' => '/pandoraupdate4/server.php'), + array('key' => 'update_server_path')); + + if ($result === false) { + db_pandora_audit("ERROR update extension", "Error in the update the extension 'update manager' when update the 'update_server_path' field."); + } + } + /* Already installed */ return; + } load_update_manager_lib (); diff --git a/pandora_console/extensions/update_manager/main.php b/pandora_console/extensions/update_manager/main.php index 2572e2064e..088d8387d2 100644 --- a/pandora_console/extensions/update_manager/main.php +++ b/pandora_console/extensions/update_manager/main.php @@ -29,9 +29,9 @@ if ($settings->customer_key == FREE_USER) { echo '
'; echo html_print_image("images/information.png", true) . ' '; /* Translators: Do not translade Update Manager, it's the name of the program */ - echo __('The new Update Manager client is shipped with Pandora FMS 3.0. It helps system administrators to update their Pandora FMS automatically, since the Update Manager does the task of getting new modules, new plugins and new features (even full migrations tools for future versions) automatically.'); + echo __('The new Update Manager client is shipped with Pandora FMS It helps system administrators to update their Pandora FMS automatically, since the Update Manager does the task of getting new modules, new plugins and new features (even full migrations tools for future versions) automatically.'); echo '

'; - echo __('Update Manager is one of the most advanced features of Pandora FMS 3.0 Enterprise version, for more information visit http://pandorafms.com.'); + echo __('Update Manager is one of the most advanced features of Pandora FMS Enterprise version, for more information visit http://pandorafms.com.'); echo '

'; echo __('Update Manager sends anonymous information about Pandora FMS usage (number of agents and modules running). To disable it, just delete extension or remove remote server address from Update Manager plugin setup.'); echo '

'; diff --git a/pandora_console/extensions/update_manager/sql/update_manager.oracle.sql b/pandora_console/extensions/update_manager/sql/update_manager.oracle.sql index ee63b258d6..c21cc7cc69 100644 --- a/pandora_console/extensions/update_manager/sql/update_manager.oracle.sql +++ b/pandora_console/extensions/update_manager/sql/update_manager.oracle.sql @@ -4,7 +4,7 @@ CREATE TABLE tupdate_settings ( key VARCHAR2(255) default '' PRIMARY KEY, value /INSERT INTO tupdate_settings VALUES ('keygen_path', '/usr/share/pandora/util/keygen') /INSERT INTO tupdate_settings VALUES ('update_server_host', 'www.artica.es') /INSERT INTO tupdate_settings VALUES ('update_server_port', '80') -/INSERT INTO tupdate_settings VALUES ('update_server_path', '/pandoraupdate321/server.php') +/INSERT INTO tupdate_settings VALUES ('update_server_path', '/pandoraupdate4/server.php') /INSERT INTO tupdate_settings VALUES ('updating_binary_path', 'Path where the updated binary files will be stored') /INSERT INTO tupdate_settings VALUES ('updating_code_path', 'Path where the updated code is stored') /INSERT INTO tupdate_settings VALUES ('dbname', '') diff --git a/pandora_console/extensions/update_manager/sql/update_manager.postgreSQL.sql b/pandora_console/extensions/update_manager/sql/update_manager.postgreSQL.sql index 6f28fc7aec..afffd905a3 100644 --- a/pandora_console/extensions/update_manager/sql/update_manager.postgreSQL.sql +++ b/pandora_console/extensions/update_manager/sql/update_manager.postgreSQL.sql @@ -1,5 +1,5 @@ CREATE TABLE "tupdate_settings" ( "key" varchar(255) default '' PRIMARY KEY, "value" varchar(255) default ''); -INSERT INTO "tupdate_settings" VALUES ('current_update', '0'), ('customer_key', 'PANDORA-FREE'), ('keygen_path', '/usr/share/pandora/util/keygen'), ('update_server_host', 'www.artica.es'), ('update_server_port', '80'), ('update_server_path', '/pandoraupdate321/server.php'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', ''); +INSERT INTO "tupdate_settings" VALUES ('current_update', '0'), ('customer_key', 'PANDORA-FREE'), ('keygen_path', '/usr/share/pandora/util/keygen'), ('update_server_host', 'www.artica.es'), ('update_server_port', '80'), ('update_server_path', '/pandoraupdate4/server.php'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', ''); CREATE TABLE "tupdate_package"( "id" SERIAL NOT NULL PRIMARY KEY, "timestamp" TIMESTAMP without time zone default NULL, "description" varchar(255) default ''); CREATE TYPE type_tupdate_type AS ENUM ('code', 'db_data', 'db_schema', 'binary'); CREATE TABLE "tupdate" ( "id" SERIAL NOT NULL PRIMARY KEY, "type" type_tupdate_type, "id_update_package" INTEGER default 0 REFERENCES "tupdate_package"("id") ON UPDATE CASCADE ON DELETE CASCADE, "filename" varchar(250) default '', "checksum" varchar(250) default '', "previous_checksum" varchar(250) default '', "svn_version" INTEGER default 0, "data" TEXT default '', "data_rollback" TEXT default '', "description" TEXT default '', "db_table_name" varchar(140) default '', "db_field_name" varchar(140) default '', "db_field_value" varchar(1024) default ''); diff --git a/pandora_console/extensions/update_manager/sql/update_manager.sql b/pandora_console/extensions/update_manager/sql/update_manager.sql index ec52550c45..fb4d615f48 100644 --- a/pandora_console/extensions/update_manager/sql/update_manager.sql +++ b/pandora_console/extensions/update_manager/sql/update_manager.sql @@ -1,5 +1,5 @@ CREATE TABLE `tupdate_settings` ( `key` varchar(255) default '', `value` varchar(255) default '', PRIMARY KEY (`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO `tupdate_settings` VALUES ('current_update', '0'), ('customer_key', 'PANDORA-FREE'), ('keygen_path', '/usr/share/pandora/util/keygen'), ('update_server_host', 'www.artica.es'), ('update_server_port', '80'), ('update_server_path', '/pandoraupdate321/server.php'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', ''); +INSERT INTO `tupdate_settings` VALUES ('current_update', '0'), ('customer_key', 'PANDORA-FREE'), ('keygen_path', '/usr/share/pandora/util/keygen'), ('update_server_host', 'www.artica.es'), ('update_server_port', '80'), ('update_server_path', '/pandoraupdate4/server.php'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', ''); CREATE TABLE `tupdate_package` ( id int(11) unsigned NOT NULL auto_increment, timestamp datetime NOT NULL, description varchar(255) default '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `tupdate` ( id int(11) unsigned NOT NULL auto_increment, type enum('code', 'db_data', 'db_schema', 'binary'), id_update_package int(11) unsigned NOT NULL default 0, filename varchar(250) default '', checksum varchar(250) default '', previous_checksum varchar(250) default '', svn_version int(4) unsigned NOT NULL default 0, data LONGTEXT default '', data_rollback LONGTEXT default '', description TEXT default '', db_table_name varchar(140) default '', db_field_name varchar(140) default '', db_field_value varchar(1024) default '', PRIMARY KEY (`id`), FOREIGN KEY (`id_update_package`) REFERENCES tupdate_package(`id`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `tupdate_journal` ( id int(11) unsigned NOT NULL auto_increment, id_update int(11) unsigned NOT NULL default 0, PRIMARY KEY (`id`), FOREIGN KEY (`id_update`) REFERENCES tupdate(`id`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;