Merge branch '1676-Tags-y-vista-de-alertas' into 'develop'

Fix tag filter in alert view - #1676

See merge request artica/pandorafms!1171
This commit is contained in:
vgilc 2018-01-29 12:48:31 +01:00
commit 1b7b17d28f
1 changed files with 27 additions and 1 deletions

View File

@ -45,7 +45,33 @@ $filter_standby = get_parameter ("filter_standby", "all");
$offset_simple = (int) get_parameter_get ("offset_simple", 0);
$id_group = (int) get_parameter ("ag_group", 0); //0 is the All group (selects all groups)
$free_search = get_parameter("free_search", '');
$tag_filter = get_parameter("tag_filter", 0);
$user_tag_array = array_values(array_keys(tags_get_user_tags($config['id_user'])));
$user_tag = '';
foreach ($user_tag_array as $key => $value) {
if ($value === end($user_tag_array)) {
$user_tag .= $value;
}
else{
$user_tag .= $value.',';
}
}
$tag_filter = get_parameter("tag_filter", $user_tag);
$tag_param_validate = explode(',',$tag_filter);
foreach ($tag_param_validate as $key => $value) {
if (!in_array($value,$user_tag_array)) {
db_pandora_audit("ACL Violation",
"Trying to access Alert view");
require ("general/noaccess.php");
exit;
}
}
if ($tag_filter) {
if ($id_group && $strict_user) {
$tag_filter = 0;