Fixed bug in event filter.

This commit is contained in:
Vanessa Gil 2014-09-29 11:27:10 +02:00
parent 83314fac0e
commit 1a6659d116
1 changed files with 23 additions and 3 deletions

View File

@ -48,9 +48,29 @@ else {
$sql_post = "";
}
else {
//Otherwise select all groups the user has rights to.
$sql_post = " AND id_grupo IN (" .
implode (",", array_keys ($groups)) . ")";
if ($meta) {
// In metaconsole the group search is performed by name
$sql_post = " AND group_name IN ( ";
$i = 0;
foreach ($groups as $group_id=>$group_name) {
if ($group_id == 0) {
continue;
}
if ($i==0) {
$sql_post .= "'$group_name'";
} else {
$sql_post .= ",'$group_name'";
}
$i++;
}
$sql_post.= ")";
} else {
//Otherwise select all groups the user has rights to.
$sql_post = " AND id_grupo IN (" .
implode (",", array_keys ($groups)) . ")";
}
}
}