[ACL API] Fixed groups in event validations

This commit is contained in:
fermin831 2018-06-19 19:53:54 +02:00
parent 0d2ee35e0f
commit 56042f596d
1 changed files with 16 additions and 3 deletions

View File

@ -7905,7 +7905,7 @@ function api_set_event_validate_filter_pro($trash1, $trash2, $other, $trash3) {
}
$table_events = 'tevento';
if (defined ('METACONSOLE')) {
if (is_metaconsole()) {
$table_events = 'tmetaconsole_event';
}
@ -7958,6 +7958,13 @@ function api_set_event_validate_filter_pro($trash1, $trash2, $other, $trash3) {
if (($other['data'][7] != null) && ($other['data'][7] != -1)) {
$filterString .= 'AND utimestamp < ' . $other['data'][7];
}
if (!users_can_manage_group_all("EW")) {
$user_groups = implode (',', array_keys(users_get_groups(
$config['id_user'], "EW", false
)));
$filterString .= " AND id_grupo IN ($user_groups) ";
}
}
$count = db_process_sql_update($table_events,
@ -7979,7 +7986,7 @@ function api_set_event_validate_filter($trash1, $trash2, $other, $trash3) {
$simulate = false;
$table_events = 'tevento';
if (defined ('METACONSOLE')) {
if (is_metaconsole()) {
$table_events = 'tmetaconsole_event';
}
@ -8000,6 +8007,12 @@ function api_set_event_validate_filter($trash1, $trash2, $other, $trash3) {
$filterString = otherParameter2Filter($other);
if (!users_can_manage_group_all("EW")) {
$user_groups = implode (',', array_keys(users_get_groups(
$config['id_user'], "EW", false
)));
$filterString .= " AND id_grupo IN ($user_groups) ";
}
}
if ($simulate) {