mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Fixed an error which prevented an user with strict ACL to see some agents
This commit is contained in:
parent
684c99aa0c
commit
415e67ebad
@ -197,12 +197,14 @@ echo '</td><td style="width:5%;"> </form></td>';
|
|||||||
|
|
||||||
echo '</tr></table>';
|
echo '</tr></table>';
|
||||||
|
|
||||||
|
if (check_acl ($config['id_user'], 0, "AW") || check_acl ($config['id_user'], 0, "AM")) {
|
||||||
echo '<div style="text-align: right; float: right;">';
|
echo '<div style="text-align: right; float: right;">';
|
||||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||||
html_print_input_hidden ('new_agent', 1);
|
html_print_input_hidden ('new_agent', 1);
|
||||||
html_print_submit_button (__('Create agent'), 'crt', false, 'class="sub next"');
|
html_print_submit_button (__('Create agent'), 'crt', false, 'class="sub next"');
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($search != "") {
|
if ($search != "") {
|
||||||
$filter = array ("string" => '%' . $search . '%');
|
$filter = array ("string" => '%' . $search . '%');
|
||||||
@ -349,6 +351,11 @@ else {
|
|||||||
|
|
||||||
if ($strict_user) {
|
if ($strict_user) {
|
||||||
|
|
||||||
|
$count_filter = array (
|
||||||
|
'order' => 'tagente.nombre COLLATE utf8_general_ci ASC',
|
||||||
|
'disabled' => 0,
|
||||||
|
'status' => $status,
|
||||||
|
'search' => $search);
|
||||||
$filter = array (
|
$filter = array (
|
||||||
'order' => 'tagente.nombre COLLATE utf8_general_ci ASC',
|
'order' => 'tagente.nombre COLLATE utf8_general_ci ASC',
|
||||||
'disabled' => 0,
|
'disabled' => 0,
|
||||||
@ -363,6 +370,7 @@ if ($strict_user) {
|
|||||||
$groups = groups_get_id_recursive($group_id, true);
|
$groups = groups_get_id_recursive($group_id, true);
|
||||||
}
|
}
|
||||||
$filter['id_group'] = implode(',', $groups);
|
$filter['id_group'] = implode(',', $groups);
|
||||||
|
$count_filter['id_group'] = $filter['id_group'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = array ('tagente.id_agente','tagente.id_grupo','tagente.id_os','tagente.ultimo_contacto','tagente.intervalo','tagente.comentarios description','tagente.quiet',
|
$fields = array ('tagente.id_agente','tagente.id_grupo','tagente.id_os','tagente.ultimo_contacto','tagente.intervalo','tagente.comentarios description','tagente.quiet',
|
||||||
@ -370,16 +378,13 @@ if ($strict_user) {
|
|||||||
|
|
||||||
$acltags = tags_get_user_module_and_tags ($config['id_user'], 'AR', $strict_user);
|
$acltags = tags_get_user_module_and_tags ($config['id_user'], 'AR', $strict_user);
|
||||||
|
|
||||||
|
$total_agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $count_filter, $fields, false, $strict_user, true);
|
||||||
|
$total_agents = count($total_agents);
|
||||||
$agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true);
|
$agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true);
|
||||||
|
|
||||||
$total_agents = count($agents);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$total_agents = 0;
|
|
||||||
$agents = false;
|
|
||||||
|
|
||||||
|
|
||||||
$total_agents = agents_get_agents(array (
|
$total_agents = agents_get_agents(array (
|
||||||
'disabled' => 0,
|
'disabled' => 0,
|
||||||
'id_grupo' => $groups,
|
'id_grupo' => $groups,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user