Fixed, now the first task for visualmap does not show in metaconsole.

This commit is contained in:
mdtrooper 2015-07-06 18:18:20 +02:00
parent 6b5df1983b
commit 3e2fd15302
4 changed files with 38 additions and 28 deletions

View File

@ -17,8 +17,12 @@
global $config; global $config;
check_login (); check_login ();
ui_require_css_file ('firts_task'); ui_require_css_file ('firts_task');
ui_print_info_message(
array(
'no_close'=>true,
'message'=> __('There are no visual console defined yet.')));
?> ?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no visual console defined yet.') ) ); ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">

View File

@ -234,9 +234,15 @@ else
$maps = visual_map_get_user_layouts ($config['id_user'], false, $maps = visual_map_get_user_layouts ($config['id_user'], false,
false, false); false, false);
if (!$maps) { if (!$maps && !defined("METACONSOLE")) {
require_once ($config['homedir'] . "/general/firts_task/map_builder.php"); 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 { else {
foreach ($maps as $map) { foreach ($maps as $map) {
// ACL for the visual console permission // ACL for the visual console permission
@ -281,7 +287,7 @@ if ($maps) {
else else
echo '<div class="" style="width: 100%; text-align: right;">'; echo '<div class="" style="width: 100%; text-align: right;">';
} }
if ($maps) { if ($maps || defined("METACONSOLE")) {
if ($vconsoles_write || $vconsoles_manage) { if ($vconsoles_write || $vconsoles_manage) {
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
echo '<form action="index.php?sec=reporting&amp;sec2=godmode/reporting/visual_console_builder" method="post">'; echo '<form action="index.php?sec=reporting&amp;sec2=godmode/reporting/visual_console_builder" method="post">';

View File

@ -765,18 +765,18 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table = '') {
* *
* @return string SQL condition for tagente_module * @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; global $config;
$condition = ''; $condition = '';
// Get all tags of the system // Get all tags of the system
$all_tags = tags_get_all_tags(false); $all_tags = tags_get_all_tags(false);
// Juanma (08/05/2014) Fix : Will have all groups retrieved (also propagated ones) // Juanma (08/05/2014) Fix : Will have all groups retrieved (also propagated ones)
$_groups_not_in = ''; $_groups_not_in = '';
foreach ($acltags as $group_id => $group_tags) { foreach ($acltags as $group_id => $group_tags) {
// Group condition (The module belongs to an agent of the group X) // 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!) // 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])."%'"; $tags_condition .= "(tags LIKE '%".io_safe_input($all_tags[$tag])."%'";
} }
$childrens = groups_get_childrens($group_id, null, true); $childrens = groups_get_childrens($group_id, null, true);
if (empty($childrens)) { if (empty($childrens)) {
$tags_condition .= sprintf(' AND id_grupo = %d )', $group_id); $tags_condition .= sprintf(' AND id_grupo = %d )', $group_id);
} else { } else {
@ -827,7 +827,7 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group
$childrens_ids[] = (int)$child['id_grupo']; $childrens_ids[] = (int)$child['id_grupo'];
} }
$ids_str = implode(',', $childrens_ids); $ids_str = implode(',', $childrens_ids);
$tags_condition .= sprintf(' AND id_grupo IN (%s) )', $ids_str); $tags_condition .= sprintf(' AND id_grupo IN (%s) )', $ids_str);
} }
} else { } else {
@ -1175,11 +1175,11 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p =
if (is_array($id_group)) { if (is_array($id_group)) {
foreach ($id_group as $group) { foreach ($id_group as $group) {
if($group > 0) { if ($group > 0) {
if(isset($acls[$group])) { if (isset($acls[$group])) {
foreach($tags as $tag) { foreach ($tags as $tag) {
$tag = tags_get_id($tag); $tag = tags_get_id($tag);
if(in_array($tag, $acls[$group])) { if (in_array($tag, $acls[$group])) {
return true; return true;
} }
} }
@ -1190,13 +1190,13 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p =
} }
} }
else { else {
foreach($acls as $acl_tags) { foreach ($acls as $acl_tags) {
foreach($tags as $tag) { foreach ($tags as $tag) {
$tag = tags_get_id($tag); $tag = tags_get_id($tag);
if(in_array($tag, $acl_tags)) { if (in_array($tag, $acl_tags)) {
return true; return true;
}
} }
}
} }
} }
@ -1204,12 +1204,12 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p =
} }
else { else {
if($id_group > 0) { if ($id_group > 0) {
if(isset($acls[$id_group])) { if (isset($acls[$id_group])) {
foreach($tags as $tag) { foreach ($tags as $tag) {
$tag = tags_get_id($tag); $tag = tags_get_id($tag);
if(in_array($tag, $acls[$id_group])) { if (in_array($tag, $acls[$id_group])) {
return true; return true;
} }
} }
@ -1220,16 +1220,16 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p =
} }
} }
else { else {
foreach($acls as $acl_tags) { foreach ($acls as $acl_tags) {
foreach($tags as $tag) { foreach ($tags as $tag) {
$tag = tags_get_id($tag); $tag = tags_get_id($tag);
if(in_array($tag, $acl_tags)) { if (in_array($tag, $acl_tags)) {
return true; return true;
} }
} }
} }
} }
} }
//return false; //return false;
$return = false; $return = false;

View File

@ -30,7 +30,7 @@ if (! check_acl ($config['id_user'], 0, "AR")) {
require ("general/noaccess.php"); require ("general/noaccess.php");
return; return;
} }
$is_admin = check_acl ($config['id_user'], 0, "PM"); $is_admin = check_acl ($config['id_user'], 0, "PM");
$user_strict = (bool) db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); $user_strict = (bool) db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);