From e2ca04a9c9a4ea44d9bb2e573d39c6eaeed100e7 Mon Sep 17 00:00:00 2001 From: esanchezm Date: Wed, 1 Apr 2009 14:00:52 +0000 Subject: [PATCH] 2009-04-01 Esteban Sanchez * godmode/alerts/alert_compounds.php: Fixed group All. * godmode/alerts/configure_alert_compound.php: Fixed group All. "Compound" labels renamed to "Correlated". * include/styles/pandora.css: Removed invisible class, which was duplicated from common.css. * include/functions_db.php: safe_acl_group() now handles group All. Fixes #2725019 and #2723089 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1586 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 13 +++++++++++++ pandora_console/godmode/alerts/alert_compounds.php | 7 +++++-- .../godmode/alerts/configure_alert_compound.php | 7 ++++--- pandora_console/include/functions_db.php | 3 +++ pandora_console/include/styles/pandora.css | 3 --- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 84704ef39a..547192d04b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2009-04-01 Esteban Sanchez + + * godmode/alerts/alert_compounds.php: Fixed group All. + + * godmode/alerts/configure_alert_compound.php: Fixed group All. + "Compound" labels renamed to "Correlated". + + * include/styles/pandora.css: Removed invisible class, which was + duplicated from common.css. + + * include/functions_db.php: safe_acl_group() now handles group All. + Fixes #2725019 and #2723089 + 2009-04-01 Esteban Sanchez * pandoradb.sql, extras/pandoradb_migrate_v2.x_to_v3.0.sql: Added diff --git a/pandora_console/godmode/alerts/alert_compounds.php b/pandora_console/godmode/alerts/alert_compounds.php index bed0516cd9..44c0c94268 100644 --- a/pandora_console/godmode/alerts/alert_compounds.php +++ b/pandora_console/godmode/alerts/alert_compounds.php @@ -39,7 +39,10 @@ if ($search != ''); $url .= '&search='.$search; $groups = get_user_groups (0, 'LM'); -$agents = get_group_agents ($id_group, false, "none"); +if ($id_group != 1 && isset ($groups[$id_group])) + $agents = get_group_agents ($id_group, false, "none"); +else + $agents = get_group_agents (array_keys ($groups), false, "none"); $delete_alert = (int) get_parameter ('delete_alert'); $enable_alert = (int) get_parameter ('enable_alert'); @@ -75,7 +78,7 @@ if ($disable_alert) { return; } -echo '

'.__('Compound alerts').'

'; +echo '

'.__('Correlated alerts').'

'; $table->id = 'filter_compound_table'; $table->width = '90%'; diff --git a/pandora_console/godmode/alerts/configure_alert_compound.php b/pandora_console/godmode/alerts/configure_alert_compound.php index dd7aedef22..010a8796d4 100644 --- a/pandora_console/godmode/alerts/configure_alert_compound.php +++ b/pandora_console/godmode/alerts/configure_alert_compound.php @@ -271,10 +271,12 @@ if ($update_compound) { } } -echo '

'.__('Configure compound alert').'

'; +echo '

'.__('Configure correlated alert').'

'; print_alert_compound_steps ($step, $id); +$groups = get_user_groups (); + $table->id = 'compound'; $table->width = '90%'; $table->style = array (); @@ -433,8 +435,7 @@ if ($step == 2) { $table->data[0][1] = print_input_text ('name', $name, '', 35, 255, true); $table->data[1][0] = __('Assigned to'); - $groups = get_user_groups (); - $table->data[1][1] = print_select (get_group_agents (), + $table->data[1][1] = print_select (get_group_agents (array_keys ($groups)), 'id_agent', $id_agent, '', __('Select'), 0, true); $table->data[2][0] = __('Description'); $table->data[2][1] = print_textarea ('description', 10, 30, diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 4633d4eb97..2dc8644c06 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -162,6 +162,9 @@ function give_acl ($id_user, $id_group, $access) { */ function safe_acl_group ($id_user, $id_groups, $access) { if (!is_array ($id_groups) && check_acl ($id_user, $id_groups, $access)) { + /* Return all the user groups if it's the group All */ + if ($id_groups == 1 || $id_groups == 0) + return array_keys (get_user_groups ($id_user, $access)); return array ($id_groups); } elseif (!is_array ($id_groups)) { return array (); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 7dc8401da6..8a00bdf850 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -743,9 +743,6 @@ code, pre { select#template, select#action { width: 250px; } -.invisible { - display: none; -} #label-checkbox-matches_value, #label-checkbox-copy_modules, #label-checkbox-copy_alerts {