From 3e2fd153029273cf127d9c11e976d61cc8fdaf0b Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 6 Jul 2015 18:18:20 +0200 Subject: [PATCH] Fixed, now the first task for visualmap does not show in metaconsole. --- .../general/firts_task/map_builder.php | 6 ++- .../godmode/reporting/map_builder.php | 10 +++- pandora_console/include/functions_tags.php | 48 +++++++++---------- .../operation/agentes/tactical.php | 2 +- 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/pandora_console/general/firts_task/map_builder.php b/pandora_console/general/firts_task/map_builder.php index 5363bdfa9f..45b5261ea6 100755 --- a/pandora_console/general/firts_task/map_builder.php +++ b/pandora_console/general/firts_task/map_builder.php @@ -17,8 +17,12 @@ global $config; check_login (); ui_require_css_file ('firts_task'); + +ui_print_info_message( + array( + 'no_close'=>true, + 'message'=> __('There are no visual console defined yet.'))); ?> -true, 'message'=> __('There are no visual console defined yet.') ) ); ?>
diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 839967706e..1056af7dbd 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -234,9 +234,15 @@ else $maps = visual_map_get_user_layouts ($config['id_user'], false, false, false); -if (!$maps) { +if (!$maps && !defined("METACONSOLE")) { require_once ($config['homedir'] . "/general/firts_task/map_builder.php"); } +elseif (!$maps && defined("METACONSOLE")) { + ui_print_info_message( + array( + 'no_close'=>true, + 'message'=> __('There are no visual console defined yet.'))); +} else { foreach ($maps as $map) { // ACL for the visual console permission @@ -281,7 +287,7 @@ if ($maps) { else echo '
'; } -if ($maps) { +if ($maps || defined("METACONSOLE")) { if ($vconsoles_write || $vconsoles_manage) { if (!defined('METACONSOLE')) { echo '
'; diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index a9a695b806..b348233210 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -765,18 +765,18 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table = '') { * * @return string SQL condition for tagente_module */ - -function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group_and_tag = false, $force_equal = false) { +function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group_and_tag = false, $force_equal = false) { + global $config; $condition = ''; - + // Get all tags of the system $all_tags = tags_get_all_tags(false); // Juanma (08/05/2014) Fix : Will have all groups retrieved (also propagated ones) $_groups_not_in = ''; - + foreach ($acltags as $group_id => $group_tags) { // Group condition (The module belongs to an agent of the group X) // Juanma (08/05/2014) Fix : Get all groups (children also, Propagate ACL func!) @@ -818,7 +818,7 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group $tags_condition .= "(tags LIKE '%".io_safe_input($all_tags[$tag])."%'"; } $childrens = groups_get_childrens($group_id, null, true); - + if (empty($childrens)) { $tags_condition .= sprintf(' AND id_grupo = %d )', $group_id); } else { @@ -827,7 +827,7 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group $childrens_ids[] = (int)$child['id_grupo']; } $ids_str = implode(',', $childrens_ids); - + $tags_condition .= sprintf(' AND id_grupo IN (%s) )', $ids_str); } } else { @@ -1175,11 +1175,11 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p = if (is_array($id_group)) { foreach ($id_group as $group) { - if($group > 0) { - if(isset($acls[$group])) { - foreach($tags as $tag) { + if ($group > 0) { + if (isset($acls[$group])) { + foreach ($tags as $tag) { $tag = tags_get_id($tag); - if(in_array($tag, $acls[$group])) { + if (in_array($tag, $acls[$group])) { return true; } } @@ -1190,13 +1190,13 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p = } } else { - foreach($acls as $acl_tags) { - foreach($tags as $tag) { - $tag = tags_get_id($tag); - if(in_array($tag, $acl_tags)) { - return true; - } + foreach ($acls as $acl_tags) { + foreach ($tags as $tag) { + $tag = tags_get_id($tag); + if (in_array($tag, $acl_tags)) { + return true; } + } } } @@ -1204,12 +1204,12 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p = } else { - if($id_group > 0) { - if(isset($acls[$id_group])) { - foreach($tags as $tag) { + if ($id_group > 0) { + if (isset($acls[$id_group])) { + foreach ($tags as $tag) { $tag = tags_get_id($tag); - if(in_array($tag, $acls[$id_group])) { + if (in_array($tag, $acls[$id_group])) { return true; } } @@ -1220,16 +1220,16 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p = } } else { - foreach($acls as $acl_tags) { - foreach($tags as $tag) { + foreach ($acls as $acl_tags) { + foreach ($tags as $tag) { $tag = tags_get_id($tag); - if(in_array($tag, $acl_tags)) { + if (in_array($tag, $acl_tags)) { return true; } } } } - } + } //return false; $return = false; diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index 0597f26659..6355d0ecdb 100755 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -30,7 +30,7 @@ if (! check_acl ($config['id_user'], 0, "AR")) { require ("general/noaccess.php"); return; } - + $is_admin = check_acl ($config['id_user'], 0, "PM"); $user_strict = (bool) db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);