mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-2608-mas-problemas-de-vistas-de-grupos-secundarios' into 'develop'
Ent 2608 mas problemas de vistas de grupos secundarios See merge request artica/pandorafms!1856
This commit is contained in:
commit
f2356a3a9b
@ -468,8 +468,6 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
|
|||||||
enterprise_include_once ('meta/include/functions_ui_meta.php');
|
enterprise_include_once ('meta/include/functions_ui_meta.php');
|
||||||
include_graphs_dependencies();
|
include_graphs_dependencies();
|
||||||
|
|
||||||
$strict_user = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']);
|
|
||||||
|
|
||||||
$is_extra = enterprise_hook('policies_is_agent_extra_policy', array($id_agente));
|
$is_extra = enterprise_hook('policies_is_agent_extra_policy', array($id_agente));
|
||||||
|
|
||||||
if ($is_extra === ENTERPRISE_NOT_HOOK) {
|
if ($is_extra === ENTERPRISE_NOT_HOOK) {
|
||||||
@ -483,9 +481,13 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the agent info
|
||||||
$agent = db_get_row ("tagente", "id_agente", $id_agente);
|
$agent = db_get_row ("tagente", "id_agente", $id_agente);
|
||||||
|
if ($agent == false) return;
|
||||||
|
|
||||||
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && ! check_acl ($config["id_user"], $agent["id_grupo"], "AW") && !$is_extra) {
|
// Check all groups
|
||||||
|
$groups = agents_get_all_groups_agent($id_agente, $agent["id_grupo"], is_metaconsole());
|
||||||
|
if (! check_acl_one_of_groups ($config["id_user"], $groups, "AR") && ! check_acl_one_of_groups ($config["id_user"], $groups, "AW") && !$is_extra) {
|
||||||
db_pandora_audit("ACL Violation",
|
db_pandora_audit("ACL Violation",
|
||||||
"Trying to access Agent General Information");
|
"Trying to access Agent General Information");
|
||||||
require_once ("general/noaccess.php");
|
require_once ("general/noaccess.php");
|
||||||
|
@ -68,13 +68,17 @@ if (is_ajax ()) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$groups_orig = users_get_groups(false, $privilege);
|
$groups_orig = users_get_groups(false, $privilege, false);
|
||||||
$groups = array_keys($groups_orig);
|
$groups = array_keys($groups_orig);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build filter
|
// Build filter
|
||||||
$filter = array();
|
$filter = array();
|
||||||
$filter['id_grupo'] = $groups;
|
// Group filter (primary and secondary)
|
||||||
|
$filter[] = "(" .db_format_array_where_clause_sql(
|
||||||
|
array('id_grupo' => $groups, 'id_group' => $groups),
|
||||||
|
'OR'
|
||||||
|
) . ")";
|
||||||
|
|
||||||
if (!empty($id_os))
|
if (!empty($id_os))
|
||||||
$filter['id_os'] = $id_os;
|
$filter['id_os'] = $id_os;
|
||||||
@ -158,12 +162,17 @@ if (is_ajax ()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
$filter['group'] = 'id_agente';
|
||||||
|
|
||||||
// Build fields
|
// Build fields
|
||||||
$fields = array('id_agente', 'alias');
|
$fields = array('id_agente', 'alias');
|
||||||
|
|
||||||
// Perform search
|
// Perform search
|
||||||
$agents = db_get_all_rows_filter('tagente', $filter, $fields);
|
$agents = db_get_all_rows_filter(
|
||||||
|
'tagente LEFT JOIN tagent_secondary_group ON id_agente=id_agent',
|
||||||
|
$filter,
|
||||||
|
$fields
|
||||||
|
);
|
||||||
if (empty($agents)) $agents = array();
|
if (empty($agents)) $agents = array();
|
||||||
|
|
||||||
foreach ($agents as $k => $v) {
|
foreach ($agents as $k => $v) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user