mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Fixed the empty agents from the filter of IP mask.
This commit is contained in:
parent
2f9fba600e
commit
5c0620e426
@ -61,8 +61,8 @@ class Networkmap extends Map {
|
||||
}
|
||||
|
||||
protected function generateDot($graph, $positions) {
|
||||
//html_debug($graph, true);
|
||||
//html_debug($positions, true);
|
||||
//~ html_debug($graph, true);
|
||||
//~ html_debug($positions, true);
|
||||
|
||||
$graph = preg_replace('/^graph .*/', '', $graph);
|
||||
|
||||
|
@ -229,9 +229,9 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
||||
$simple = 0, $font_size = 12, $layout = 'radial', $nooverlap = 0,
|
||||
$zoom = 1, $ranksep = 2.5, $center = 0, $regen = 1, $pure = 0,
|
||||
$id_networkmap = 0, $show_snmp_modules = 0, $cut_names = true,
|
||||
$relative = false, $text_filter = '', $l2_network_or_mixed = false, $ip_mask = null,
|
||||
$dont_show_subgroups = false, $strict_user = false, $size_canvas = null,
|
||||
$old_mode = false) {
|
||||
$relative = false, $text_filter = '', $l2_network_or_mixed = false,
|
||||
$ip_mask = null, $dont_show_subgroups = false, $strict_user = false,
|
||||
$size_canvas = null, $old_mode = false) {
|
||||
|
||||
global $config;
|
||||
|
||||
@ -385,7 +385,8 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
||||
$modules = tags_get_agent_modules ($agent['id_agente'], false, $acltags, false, $filter, false);
|
||||
}
|
||||
else {
|
||||
$modules = agents_get_modules($agent['id_agente'], '*', $filter, true, true);
|
||||
$modules = agents_get_modules(
|
||||
$agent['id_agente'], '*', $filter, true, true);
|
||||
}
|
||||
|
||||
if ($modules === false)
|
||||
@ -1844,14 +1845,20 @@ function networkmap_get_new_nodes_from_ip_mask($ip_mask, $fields = array(), $str
|
||||
foreach ($list_address as $address) {
|
||||
foreach ($list_ip_masks as $ip_mask) {
|
||||
if (networkmap_cidr_match($address['ip'], $ip_mask)) {
|
||||
$id_agent = db_get_value_filter('id_agent', 'taddress_agent', array('id_a' => $address['id_a']));
|
||||
$id_agent = db_get_value_filter('id_agent', 'taddress_agent',
|
||||
array('id_a' => $address['id_a']));
|
||||
|
||||
if (empty($id_agent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (empty($fields)) {
|
||||
if ($strict_user) {
|
||||
if (array_key_exists($id_agent, $user_agents)) {
|
||||
$agents[] = db_get_value_filter('id_agent', 'taddress_agent', array('id_a' => $address['id_a']));
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$agents[] = db_get_value_filter('id_agent', 'taddress_agent', array('id_a' => $address['id_a']));
|
||||
}
|
||||
|
||||
@ -1861,7 +1868,8 @@ function networkmap_get_new_nodes_from_ip_mask($ip_mask, $fields = array(), $str
|
||||
if (array_key_exists($id_agent, $user_agents)) {
|
||||
$agents[] = db_get_row('tagente', 'id_agente', $id_agent, $fields);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$agents[] = db_get_row('tagente', 'id_agente', $id_agent, $fields);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user