From a8ad0542e2e596033a5092aaa9ed561e9e3b8a36 Mon Sep 17 00:00:00 2001 From: slerena Date: Wed, 10 Mar 2010 17:58:29 +0000 Subject: [PATCH] 2010-03-10 Sancho Lerena * pandoradb_data.sql: Added new default values for purge event, string data, audit data, gis data, and snmp trap data. * include/functions_config.php: Support for new gis_purge config token. * godmode/setup/performance.php: Added gis_purge to setup. * godmode/users/user_list.php: Fixed bug which doesn't allow to delete users. * godmode/users/configure_user.php: Fixed bug with profile assigment (Mixed the current user and selected user). * Install.php: Show default user/password after install. Build update. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2501 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 16 +++++ pandora_console/godmode/setup/performance.php | 45 +++++++------- .../godmode/users/configure_user.php | 16 +++-- pandora_console/godmode/users/user_list.php | 4 +- pandora_console/include/config_process.php | 2 +- pandora_console/include/functions_config.php | 10 ++- pandora_console/install.php | 3 +- pandora_console/pandoradb_data.sql | 61 ++++++++++--------- 8 files changed, 96 insertions(+), 61 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 58c6a2e01a..052b18fe65 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,19 @@ +2010-03-10 Sancho Lerena + + * pandoradb_data.sql: Added new default values for purge event, + string data, audit data, gis data, and snmp trap data. + + * include/functions_config.php: Support for new gis_purge config + token. + + * godmode/setup/performance.php: Added gis_purge to setup. + + * godmode/users/user_list.php: Fixed bug which doesn't allow to + delete users. + + * godmode/users/configure_user.php: Fixed bug with profile assigment + (Mixed the current user and selected user). + 2010-03-10 Junichi Satoh * general/license/pandora_info_ja.html : Added the GPL in Japanese. diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index 2cfd91a8ea..98f8b0aa6f 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -55,35 +55,38 @@ $table->data[3][1] = print_input_text ('audit_purge', $config["audit_purge"], '' $table->data[4][0] = __('Max. days before delete string data'); $table->data[4][1] = print_input_text ('string_purge', $config["string_purge"], '', 5, 5, true); -$table->data[5][0] = __('Max. days before purge'); -$table->data[5][1] = print_input_text ('days_purge', $config["days_purge"], '', 5, 5, true); +$table->data[5][0] = __('Max. days before delete GIS data'); +$table->data[5][1] = print_input_text ('gis_purge', $config["gis_purge"], '', 5, 5, true); -$table->data[6][0] = __('Max. days before compact data'); -$table->data[6][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true); +$table->data[6][0] = __('Max. days before purge'); +$table->data[6][1] = print_input_text ('days_purge', $config["days_purge"], '', 5, 5, true); -$table->data[7][0] = __('Compact interpolation in hours (1 Fine-20 bad)'); -$table->data[7][1] = print_input_text ('step_compact', $config["step_compact"], '', 5, 5, true); +$table->data[7][0] = __('Max. days before compact data'); +$table->data[7][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true); -$table->data[8][0] = __('SLA period (seconds)'); -$table->data[8][1] = print_input_text ('sla_period', $config["sla_period"], '', 8, 8, true); +$table->data[8][0] = __('Compact interpolation in hours (1 Fine-20 bad)'); +$table->data[8][1] = print_input_text ('step_compact', $config["step_compact"], '', 5, 5, true); -$table->data[9][0] = __('Default hours for event view'); -$table->data[9][1] = print_input_text ('event_view_hr', $config["event_view_hr"], '', 5, 5, true); +$table->data[9][0] = __('SLA period (seconds)'); +$table->data[9][1] = print_input_text ('sla_period', $config["sla_period"], '', 8, 8, true); -$table->data[10][0] = __('Compact CSS and JS into header'); -$table->data[10][1] = __('Yes').' '.print_radio_button ('compact_header', 1, '', $config["compact_header"], true).'  '; -$table->data[10][1] .= __('No').' '.print_radio_button ('compact_header', 0, '', $config["compact_header"], true); +$table->data[10][0] = __('Default hours for event view'); +$table->data[10][1] = print_input_text ('event_view_hr', $config["event_view_hr"], '', 5, 5, true); -$table->data[11][0] = __('Use realtime statistics'); -$table->data[11][1] = __('Yes').' '.print_radio_button ('realtimestats', 1, '', $config["realtimestats"], true).'  '; -$table->data[11][1] .= __('No').' '.print_radio_button ('realtimestats', 0, '', $config["realtimestats"], true); +$table->data[11][0] = __('Compact CSS and JS into header'); +$table->data[11][1] = __('Yes').' '.print_radio_button ('compact_header', 1, '', $config["compact_header"], true).'  '; +$table->data[11][1] .= __('No').' '.print_radio_button ('compact_header', 0, '', $config["compact_header"], true); -$table->data[12][0] = __('Batch statistics period (secs)'); -$table->data[12][1] = print_input_text ('stats_interval', $config["stats_interval"], '', 5, 5, true); +$table->data[12][0] = __('Use realtime statistics'); +$table->data[12][1] = __('Yes').' '.print_radio_button ('realtimestats', 1, '', $config["realtimestats"], true).'  '; +$table->data[12][1] .= __('No').' '.print_radio_button ('realtimestats', 0, '', $config["realtimestats"], true); -$table->data[13][0] = __('Use agent access graph'). print_help_icon("agent_access", true); -$table->data[13][1] = __('Yes').' '.print_radio_button ('agentaccess', 1, '', $config["agentaccess"], true).'  '; -$table->data[13][1] .= __('No').' '.print_radio_button ('agentaccess', 0, '', $config["agentaccess"], true); +$table->data[13][0] = __('Batch statistics period (secs)'); +$table->data[13][1] = print_input_text ('stats_interval', $config["stats_interval"], '', 5, 5, true); + +$table->data[14][0] = __('Use agent access graph'). print_help_icon("agent_access", true); +$table->data[14][1] = __('Yes').' '.print_radio_button ('agentaccess', 1, '', $config["agentaccess"], true).'  '; +$table->data[14][1] .= __('No').' '.print_radio_button ('agentaccess', 0, '', $config["agentaccess"], true); echo '
'; print_input_hidden ('update_config', 1); diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index a2cf31ae7e..b162bf6b3a 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -17,12 +17,16 @@ global $config; check_login (); + +// This defines the working user. Beware with this, old code get confusses +// and operates with current logged user (dangerous). + $id = get_parameter ('id', $config['id_user']); // ID given as parameter + $user_info = get_user_info ($id); if ($user_info["language"] == ""){ $user_info["language"] = $config["language"]; } -$id = $user_info['id_user']; if (! give_acl ($config['id_user'], 0, "UM")) { audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "ACL Violation", @@ -152,7 +156,7 @@ if ($update_user) { } if ($add_profile) { - $id2 = (string) get_parameter ('id_user'); + $id2 = (string) get_parameter ('id'); $group2 = (int) get_parameter ('assign_group'); $profile2 = (int) get_parameter ('assign_profile'); audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "User management", @@ -164,13 +168,13 @@ if ($add_profile) { } if ($delete_profile) { - $id = (string) get_parameter ('id_user'); + $id2 = (string) get_parameter ('id_user'); $id_up = (int) get_parameter ('id_user_profile'); audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "User management", - "Deleted profile for user ".safe_input($id)); + "Deleted profile for user ".safe_input($id2)); - $return = delete_user_profile ($id, $id_up); + $return = delete_user_profile ($id2, $id_up); print_result_message ($return, __('Successfully deleted'), __('Could not be deleted')); @@ -305,7 +309,7 @@ $data[0] .= print_select (get_profiles (), 'assign_profile', 0, '', __('None'), $data[1] = print_select (get_user_groups ($config['id_user'], 'UM'), 'assign_group', 0, '', __('None'), 0, true, false, false); $data[2] = print_input_image ('add', 'images/add.png', 1, '', true); -$data[2] .= print_input_hidden ('id_user', $id, true); +$data[2] .= print_input_hidden ('id', $id, true); $data[2] .= print_input_hidden ('add_profile', 1, true); $data[2] .= '
'; diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index defd705f4b..4ba8db6a68 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -28,7 +28,6 @@ if (! give_acl ($config['id_user'], 0, "UM")) { // Header print_page_header (__('User management').' » '.__('Users defined in Pandora'), "images/god3.png", false, "", true); - if (isset ($_GET["user_del"])) { //delete user $id_user = get_parameter_post ("delete_user"); $result = delete_user ($id_user); @@ -115,8 +114,9 @@ foreach ($info as $user_id => $user_info) { $data[3] .= ""; $data[4] = print_string_substr ($user_info["comments"], 24, true); + if ($config["admin_can_delete_user"]) { - $data[5] = print_input_image ("delete_user", "images/cross.png", $user_id, 'border:0px;', true); //Delete user button + $data[5] = print_input_image ("delete_user", "images/cross.png", $row["id_usuario"], 'border:0px;', true); //Delete user button } else { $data[5] = ''; //Delete button not in this mode } diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index b4904ae276..f7fef04dcf 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC100303'; // Remember is YYMMDD +$build_version = 'PC100310'; // Remember is YYMMDD $pandora_version = 'v3.1-dev'; /* Help to debug problems. Override global PHP configuration */ diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 51745136e7..3aab53a723 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -92,8 +92,10 @@ function update_config_value ($token, $value) { break; default: - if (!isset ($config[$token])) + if (!isset ($config[$token])){ + $config[$token] = $value; return (bool) create_config_value ($token, $value); + } /* If it has not changed */ if ($config[$token] == $value) @@ -178,7 +180,7 @@ function update_config () { update_config_value ('audit_purge', get_parameter ('audit_purge', $config['audit_purge'])); update_config_value ('acl_enterprise', get_parameter ('acl_enterprise', $config['acl_enterprise'])); update_config_value ('metaconsole', get_parameter ('metaconsole', $config['metaconsole'])); - + update_config_value ('gis_purge', get_parameter ('gis_purge', $config['gis_purge'])); } /** @@ -306,6 +308,10 @@ function process_config () { update_config_value ('metaconsole', 0); } + if (!isset ($config["gis_purge"])){ + update_config_value ('gis_purge', 7); + } + /* *Parse the ACL IP list for access API that it's save in chunks as *list_ACL_IPs_for_API_, because the value has a limit of 100 diff --git a/pandora_console/install.php b/pandora_console/install.php index cdccc61792..6f5fd6d09c 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -35,7 +35,7 @@ install.php') file before trying to access to your Pandora FMS console.

You should also install Pandora FMS Servers before trying to monitor anything; please read documentation on how to install it.

+

Default user is 'admin' with password 'pandora', please change it both as soon as possible.

Don't forget to check http://pandorafms.com for updates.


Click here to access to your Pandora FMS console. diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 4d42cbf8b6..b11e01f934 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -39,34 +39,39 @@ INSERT INTO `talert_commands` VALUES (9,'SMS','sendsms _field1_ _field2_','Send -- LOCK TABLES `tconfig` WRITE; -INSERT INTO `tconfig` VALUES -(1,'language','en'), -(3,'block_size','20'), -(4,'days_purge','60'), -(5,'days_compact','15'), -(6,'graph_res','5'), -(7,'step_compact','1'), -(8,'db_scheme_version','3.1-dev'), -(9,'db_scheme_build','PD100302'), -(13,'show_unknown','0'), -(14,'show_lastalerts','1'), -(15,'style','pandora'), -(16, 'remote_config', '/var/spool/pandora/data_in'), -(17, 'graph_color1', '#38B800'), -(18, 'graph_color2', '#42D100'), -(19, 'graph_color3', '#89FF09'), -(20, 'sla_period', '604800'), -(21, 'trap2agent', '0'), -(22, 'date_format', 'F j, Y, g:i a'), -(23, 'event_view_hr', 8), -(24, 'loginhash_pwd', ''), -(25, 'trap2agent', 0), -(26, 'prominent_time', 0), -(27, 'timesource', 'system'), -(28, 'realtimestats', '1'), -(29, 'stats_interval', '60'), -(30, 'activate_gis', '0'), -(31, 'timezone', 'Europe/Berlin'); +INSERT INTO `tconfig` (`token`, `value`) VALUES +('language','en'), +('block_size','20'), +('days_purge','60'), +('days_compact','15'), +('graph_res','5'), +('step_compact','1'), +('db_scheme_version','3.1-dev'), +('db_scheme_build','PD100302'), +('show_unknown','0'), +('show_lastalerts','1'), +('style','pandora'), +('remote_config', '/var/spool/pandora/data_in'), +('graph_color1', '#38B800'), +('graph_color2', '#42D100'), +('graph_color3', '#89FF09'), +('sla_period', '604800'), +('trap2agent', '0'), +('date_format', 'F j, Y, g:i a'), +('event_view_hr', 8), +('loginhash_pwd', ''), +('trap2agent', 0), +('prominent_time', 0), +('timesource', 'system'), +('realtimestats', '1'), +('stats_interval', '60'), +('activate_gis', '0'), +('timezone', 'Europe/Berlin'), +('string_purge', 7), +('audit_purge', 15), +('trap_purge', 7), +('event_purge', 15), +('gis_purge', 15); UNLOCK TABLES;