From cfdd08b549133af138dcd1767944dd4592698a9c Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Thu, 10 Jan 2013 15:23:06 +0000 Subject: [PATCH] 2013-01-10 Juan Manuel Ramon * pandoradb_data.sql include/functions_config.php pandoradb.data.postgreSQL.sql pandoradb.data.oracle.sql godmode/setup/performance.php: Max recommended number of files in attachment directory parametrized. Merged from branches. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7423 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 +++++++++++ pandora_console/godmode/setup/performance.php | 2 ++ pandora_console/include/functions_config.php | 9 +++++++-- pandora_console/pandoradb.data.oracle.sql | 1 + pandora_console/pandoradb.data.postgreSQL.sql | 3 ++- pandora_console/pandoradb_data.sql | 3 ++- 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 88fd1f14c7..eef79d3805 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2013-01-10 Juan Manuel Ramon + + * pandoradb_data.sql + include/functions_config.php + pandoradb.data.postgreSQL.sql + pandoradb.data.oracle.sql + godmode/setup/performance.php: Max recommended number of files in + attachment directory parametrized. + + Merged from branches. + 2013-01-10 Juan Manuel Ramon * include/functions_networkmap.php: Fixed entity problem in diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index bf2e0a57c8..4586c13baa 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -110,6 +110,8 @@ $table_other->data[7][0] = __('Use agent access graph') . ui_print_help_icon("ag $table_other->data[7][1] = __('Yes').' '.html_print_radio_button ('agentaccess', 1, '', $config["agentaccess"], true).'  '; $table_other->data[7][1] .= __('No').' '.html_print_radio_button ('agentaccess', 0, '', $config["agentaccess"], true); +$table_other->data[8][0] = __('Max. recommended number of files in attachment directory') . ui_print_help_tip(__('This number is the maximum number of files in attachment directory. If this number is reached then a warning message will appear in the header notification space.'), true); +$table_other->data[8][1] = html_print_input_text ('num_files_attachment', $config["num_files_attachment"], '', 5, 5, true); echo '
'; echo "
"; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index e064b505a1..be06afc624 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -211,6 +211,7 @@ function config_update_config () { config_update_value ('stats_interval', get_parameter ('stats_interval')); config_update_value ('agentaccess', (int) get_parameter ('agentaccess')); config_update_value ('compact_header', (bool) get_parameter ('compact_header')); + config_update_value ('num_files_attachment', (int) get_parameter ('num_files_attachment')); ///////////// break; case 'godmode/setup/setup_visuals': @@ -377,6 +378,10 @@ function config_process_config () { config_update_value ('compact_header', false); } + if (!isset ($config["num_files_attachment"])) { + config_update_value ('num_files_attachment', 100); + } + if (!isset ($config['status_images_set'])) { config_update_value ('status_images_set', 'default'); } @@ -882,8 +887,8 @@ function config_check () { // Check attachment directory (too much files?) $filecount = count(glob($config["homedir"]."/attachment/*")); - // 100 temporal files of trash should be enough for most people. - if ($filecount > 100) { + // N temporal files of trash should be enough for most people. + if ($filecount > $config['num_files_attachment']) { $config["alert_cnt"]++; $_SESSION["alert_msg"] .= ui_print_error_message( array('title' => __('Too much files in your tempora/attachment directory'), diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 9c2f6eb27f..98998173c6 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -109,6 +109,7 @@ INSERT INTO tconfig (token, value) VALUES ('meta_style', 'meta_pandora'); INSERT INTO tconfig (token, value) VALUES ('enable_refr', 0); INSERT INTO tconfig (token, value) VALUES ('meta_num_elements', 100); INSERT INTO tconfig (token, value) VALUES ('update_manager_installed', 1); +INSERT INTO tconfig (token, value) VALUES ('num_files_attachment', 100); COMMIT; END;; diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index 3d208f66f3..10f0ba9452 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -104,7 +104,8 @@ INSERT INTO "tconfig" ("token", "value") VALUES ('meta_style', 'meta_pandora'), ('enable_refr', '0'), ('meta_num_elements', 100), -('update_manager_installed', 1); +('update_manager_installed', 1), +('num_files_attachment', 100); COMMIT WORK; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index c063ef8620..f4ea39a979 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -103,7 +103,8 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('meta_style', 'meta_pandora'), ('enable_refr', 0), ('meta_num_elements', 100), -('update_manager_installed', 1); +('update_manager_installed', 1), +('num_files_attachment', 100); UNLOCK TABLES;