From d6ad7463672955712e046e3a5fd69e339c0638a5 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Thu, 10 Nov 2011 19:19:38 +0000 Subject: [PATCH] 2011-11-10 Juan Manuel Ramon * godmode/massive/massive_add_alerts.php godmode/massive/massive_delete_agents.php godmode/massive/massive_enable_disable_alerts.php godmode/massive/massive_operations.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.php godmode/massive/massive_delete_action_alerts.php godmode/massive/massive_delete_modules.php godmode/massive/massive_add_profiles.php godmode/massive/massive_delete_alerts.php godmode/massive/massive_edit_modules.php godmode/massive/massive_standby_alerts.php godmode/massive/massive_add_action_alerts.php: Added spinner while waiting to massive operations result and added check of PHP conf. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5126 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 17 ++++ .../massive/massive_add_action_alerts.php | 2 +- .../godmode/massive/massive_add_alerts.php | 2 +- .../godmode/massive/massive_add_profiles.php | 2 +- .../massive/massive_delete_action_alerts.php | 2 +- .../godmode/massive/massive_delete_agents.php | 2 +- .../godmode/massive/massive_delete_alerts.php | 4 +- .../massive/massive_delete_modules.php | 2 +- .../massive/massive_delete_profiles.php | 2 +- .../godmode/massive/massive_edit_agents.php | 3 +- .../godmode/massive/massive_edit_modules.php | 2 +- .../massive/massive_enable_disable_alerts.php | 4 +- .../godmode/massive/massive_operations.php | 77 +++++++++++++++++++ .../massive/massive_standby_alerts.php | 2 +- 14 files changed, 109 insertions(+), 14 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ca3f6d0af2..4e5d91dc47 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2011-11-10 Juan Manuel Ramon + + * godmode/massive/massive_add_alerts.php + godmode/massive/massive_delete_agents.php + godmode/massive/massive_enable_disable_alerts.php + godmode/massive/massive_operations.php + godmode/massive/massive_delete_profiles.php + godmode/massive/massive_edit_agents.php + godmode/massive/massive_delete_action_alerts.php + godmode/massive/massive_delete_modules.php + godmode/massive/massive_add_profiles.php + godmode/massive/massive_delete_alerts.php + godmode/massive/massive_edit_modules.php + godmode/massive/massive_standby_alerts.php + godmode/massive/massive_add_action_alerts.php: Added spinner while + waiting to massive operations result and added check of PHP conf. + 2011-11-08 Juan Manuel Ramon * operation/reporting/reporting_viewer.php: Added begin date control diff --git a/pandora_console/godmode/massive/massive_add_action_alerts.php b/pandora_console/godmode/massive/massive_add_action_alerts.php index aa9e094093..44fb2151f9 100644 --- a/pandora_console/godmode/massive/massive_add_action_alerts.php +++ b/pandora_console/godmode/massive/massive_add_action_alerts.php @@ -203,7 +203,7 @@ $table->data[4][1] .= html_print_input_text ('fires_max', 0, '', 4, 10, true); $table->data[4][1] .= ui_print_help_icon ("alert-matches", true); $table->data[4][1] .= ''; -echo '
'; +echo ''; html_print_table ($table); echo '
'; diff --git a/pandora_console/godmode/massive/massive_add_alerts.php b/pandora_console/godmode/massive/massive_add_alerts.php index dc2b17a4c9..79c93b74f8 100644 --- a/pandora_console/godmode/massive/massive_add_alerts.php +++ b/pandora_console/godmode/massive/massive_add_alerts.php @@ -143,7 +143,7 @@ $table->data[2][1] = html_print_select (index_array ($templates, 'id', 'name'), $table->data[2][2] = ''; $table->data[2][3] = ''; -echo ''; +echo ''; html_print_table ($table); echo '
'; diff --git a/pandora_console/godmode/massive/massive_add_profiles.php b/pandora_console/godmode/massive/massive_add_profiles.php index 9098f636b5..0f3027b804 100644 --- a/pandora_console/godmode/massive/massive_add_profiles.php +++ b/pandora_console/godmode/massive/massive_add_profiles.php @@ -93,7 +93,7 @@ $table->size[1] = '33%'; $table->size[2] = '33%'; $data = array (); -$data[0] = ''; +$data[0] = ''; $data[0] .= html_print_select (profile_get_profiles (), 'profiles_id[]', '', '', '', '', true, true, false, '', false, 'width: 100%'); $data[1] = html_print_select_groups($config['id_user'], "UM", true, diff --git a/pandora_console/godmode/massive/massive_delete_action_alerts.php b/pandora_console/godmode/massive/massive_delete_action_alerts.php index d0fa310c72..babd80940c 100644 --- a/pandora_console/godmode/massive/massive_delete_action_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_action_alerts.php @@ -202,7 +202,7 @@ $actions = alerts_get_alert_actions (); $table->data[4][0] = __('Action'); $table->data[4][1] = html_print_select ($actions, 'action', '', '', __('None'), 0, true); -echo ''; +echo ''; html_print_table ($table); echo '
'; diff --git a/pandora_console/godmode/massive/massive_delete_agents.php b/pandora_console/godmode/massive/massive_delete_agents.php index e682ef2740..2851f2fd4b 100644 --- a/pandora_console/godmode/massive/massive_delete_agents.php +++ b/pandora_console/godmode/massive/massive_delete_agents.php @@ -110,7 +110,7 @@ $table->data[1][0] .= ''; $table->data[1][1] = html_print_select (agents_get_group_agents ($id_group, false, "none"), 'id_agents[]', 0, false, '', '', true, true); -echo ''; +echo ''; html_print_table ($table); echo '
'; diff --git a/pandora_console/godmode/massive/massive_delete_alerts.php b/pandora_console/godmode/massive/massive_delete_alerts.php index 02bf6fa820..14876ff4ba 100644 --- a/pandora_console/godmode/massive/massive_delete_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_alerts.php @@ -161,10 +161,10 @@ $table->data[2][1] = html_print_select (index_array ($agents_alerts, 'id_agente' $table->data[2][2] = __('Modules'); $table->data[2][3] = html_print_select (array(), 'module[]', '', false, '', '', true, true, false); -echo ''; +echo ''; html_print_table ($table); -echo '
'; +echo '
'; html_print_input_hidden ('delete', 1); html_print_submit_button (__('Delete'), 'go', false, 'class="sub delete"'); echo '
'; diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php index 2eb9ce1281..113b04967b 100644 --- a/pandora_console/godmode/massive/massive_delete_modules.php +++ b/pandora_console/godmode/massive/massive_delete_modules.php @@ -140,7 +140,7 @@ $agents = modules_get_agents_with_module_name ($module_name, $id_group, $table->data[2][1] = html_print_select (index_array ($agents, 'id_agente', 'nombre'), 'id_agents[]', 0, false, __('None'), 0, true, true, true, '', empty ($module_name)); -echo ''; +echo ''; html_print_table ($table); echo '
'; diff --git a/pandora_console/godmode/massive/massive_delete_profiles.php b/pandora_console/godmode/massive/massive_delete_profiles.php index 15f3489567..55afde0b85 100644 --- a/pandora_console/godmode/massive/massive_delete_profiles.php +++ b/pandora_console/godmode/massive/massive_delete_profiles.php @@ -109,7 +109,7 @@ $table->size[1] = '33%'; $table->size[2] = '33%'; $data = array (); -$data[0] = ''; +$data[0] = ''; $data[0] .= html_print_select (profile_get_profiles (), 'profiles_id[]', '', '', '', '', true, false, false, '', false, 'width: 100%'); $data[1] = html_print_select_groups($config['id_user'], "UM", true, diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 5765ed29b5..1e8fec03f5 100644 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -208,7 +208,8 @@ $all_agents = agents_get_group_agents ($id_group, array('disabled' => 1), "none" $table->data[1][1] = html_print_select ($all_agents, 'id_agents[]', 0, false, '', '', true, true); -echo ''; +echo ''; +//echo ''; html_print_table ($table); $nombre_agente = ""; diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 1e35b2c624..2312a8ce0f 100644 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -364,7 +364,7 @@ $table->data['edit8'][2] = __('Tags'); $table->data['edit8'][3] = html_print_select_from_sql ('SELECT id_tag, name FROM ttag ORDER BY name', 'id_tag[]', $id_tag, '',__('None'),'0', true, true, false, false); -echo ''; +echo ''; html_print_table ($table); echo '
'; diff --git a/pandora_console/godmode/massive/massive_enable_disable_alerts.php b/pandora_console/godmode/massive/massive_enable_disable_alerts.php index a9d8789a06..9939f25ee4 100644 --- a/pandora_console/godmode/massive/massive_enable_disable_alerts.php +++ b/pandora_console/godmode/massive/massive_enable_disable_alerts.php @@ -1,4 +1,4 @@ -size[3] = '15%'; $table->data = array (); -$table->data[0][0] = ''; +$table->data[0][0] = ''; $table->data[0][0] .= html_print_input_hidden('id_alert_template_enabled', $id_alert_templates, true); $table->data[0][0] .= __('Group'); diff --git a/pandora_console/godmode/massive/massive_operations.php b/pandora_console/godmode/massive/massive_operations.php index 025609c3b4..93d5b318a0 100644 --- a/pandora_console/godmode/massive/massive_operations.php +++ b/pandora_console/godmode/massive/massive_operations.php @@ -131,6 +131,83 @@ $onheader['policies'] = $policiestab; ui_print_page_header (__('Massive operations'). ' » '. $options[$option], "images/sitemap_color.png", false, "", true, $onheader); +// Checks if the PHP configuration is correctly +if ((get_cfg_var("max_execution_time") != 0) or (get_cfg_var("max_input_time") != -1)){ + echo '
'; + echo __("In order to perform massive operations, PHP needs a correct configuration in timeout parameters. Please, open your PHP configuration file (php.ini) for example: sudo vi /etc/php5/apache2/php.ini;
And set your timeout parameters to a correct value:
max_execution_time = 0 and max_input_time = -1"); + echo '
'; +} + +// Catch all submit operations in this view to display Wait banner +$submit_action = get_parameter('go'); +$submit_update = get_parameter('updbutton'); +$submit_del = get_parameter('del'); +$submit_template_disabled = get_parameter('id_alert_template_disabled'); +$submit_template_enabled = get_parameter('id_alert_template_enabled'); +$submit_template_not_standby = get_parameter('id_alert_template_not_standby'); +$submit_template_standby = get_parameter('id_alert_template_standby'); +$submit_add = get_parameter('crtbutton'); + +/*if (!empty($submit_action) or !empty($submit_update) or !empty($submit_del) + or !empty($submit_template_disabled) or !empty($submit_template_enabled) + or !empty($submit_template_not_standby) or !empty($submit_template_standby) + or !empty($submit_add)){*/ + echo '
'; + echo html_print_image("images/wait.gif", true, array("border" => '0')) . '
'; + echo ''.__('Please wait').'...'; + echo '
'; +//} + +?> + + + +'; echo '
'; echo ''; diff --git a/pandora_console/godmode/massive/massive_standby_alerts.php b/pandora_console/godmode/massive/massive_standby_alerts.php index 7bbc77948d..dfef87ea1d 100644 --- a/pandora_console/godmode/massive/massive_standby_alerts.php +++ b/pandora_console/godmode/massive/massive_standby_alerts.php @@ -125,7 +125,7 @@ $table->size[3] = '15%'; $table->data = array (); $templates = alerts_get_alert_templates (false, array ('id', 'name')); -$table->data[0][0] = ''; +$table->data[0][0] = ''; $table->data[0][0] .= html_print_input_hidden('id_alert_template_not_standby', $id_alert_templates, true); $table->data[0][0] .= __('Group'); $table->data[0][1] = html_print_select_groups(false, "AR", true, 'id_group', $id_group,