diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 95ee92381f..d280150834 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2014-05-05 Juan Manuel Ramon + + * pandora_console/include/functions_groups.php + pandora_console/include/functions_events.php: Fixed bug + in event viewer. A user could not be assigned himself as + the owner of the event. +2014-05-05 Juan Manuel Ramon + + * pandora_console/include/functions_groups.php + pandora_console/include/functions_events.php: Fixed bug + in event viewer. A user could not be assigned himself as + the owner of the event. + 2014-05-05 Alejandro Gallardo * include/functions_netflow.php: Added an overflow diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 8589042f2a..98389f3fc0 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1544,8 +1544,10 @@ function events_page_responses ($event) { foreach($profiles_view_events as $k => $v) { $profiles_view_events[$k] = reset($v); } - $users = groups_get_users($event['id_grupo'], array('id_perfil' => $profiles_view_events), true); - + // Juanma (05/05/2014) Fix : Propagate ACL hell! + $_user_groups = array_keys(users_get_groups($config['id_user'], 'ER', users_can_manage_group_all())); + $users = groups_get_users($_user_groups, array('id_perfil' => $profiles_view_events), true, true); + foreach($users as $u) { $owners[$u['id_user']] = $u['fullname']; } diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index 56f49331cf..d5cc5db349 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -590,10 +590,11 @@ function groups_get_id ($group_name, $returnAllGroup = false) { * @param int $id_group The group id to look for * @param mixed filter array * @param bool True if users with all permissions in the group are retrieved + * @param bool Is id_group an array or not #Fix * * @return array An array with all the users or an empty array */ -function groups_get_users ($id_group, $filter = false, $return_user_all = false) { +function groups_get_users ($id_group, $filter = false, $return_user_all = false, $_is_array = false) { global $config; if (! is_array ($filter)) @@ -602,8 +603,14 @@ function groups_get_users ($id_group, $filter = false, $return_user_all = false) $filter['id_grupo'] = $id_group; $result_a = array(); - if (!is_array($id_group) && !empty($id_group)) { + // Juanma (05/05/2014) Fix: Check for number/array id_group variable + if ($_is_array && is_array($id_group) && !empty($id_group)) { $result_a = db_get_all_rows_filter ("tusuario_perfil", $filter); + } else { + if (!is_array($id_group) && !empty($id_group)) { + $result_a = db_get_all_rows_filter ("tusuario_perfil", $filter); + } + } $result_b = array();