mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Some tidying up of variables/array
This commit is contained in:
@@ -42,6 +42,7 @@ $tmp_exp_ids = implode(',',$tmp_ids);
|
||||
|
||||
$port_ids = array();
|
||||
$port_devices = array();
|
||||
$tmp_links = array();
|
||||
foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `remote_port_id`, GREATEST(`P`.`port_id`,`M`.`port_id`) AS `local_port_id` FROM `ipv4_mac` AS `M` LEFT JOIN `ports` AS `P` ON `M`.`mac_address` = `P`.`ifPhysAddress` LEFT JOIN `devices` AS `D` ON `P`.`device_id`=`D`.`device_id` WHERE `P`.`port_id` IS NOT NULL AND `M`.`port_id` IS NOT NULL AND `M`.`port_id` != 0 AND `P`.`port_id` != 0 $mac_sql", $mac_array) as $macs) {
|
||||
if (!in_array($macs['local_port_id'], $port_ids) && port_permitted($macs['local_port_id'])) {
|
||||
$port_det = dbFetchRow("SELECT * FROM `ports` WHERE `port_id`=?", array($macs['local_port_id']));
|
||||
@@ -93,6 +94,7 @@ foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `re
|
||||
}
|
||||
}
|
||||
$tmp_links[] = array('from'=>$from,'to'=>$to,'label'=>$port,'title'=>generate_port_link($port_data, "<img src='graph.php?type=port_bits&id=".$port_data['port_id']."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=100&height=20&legend=no&bg=".str_replace("#","", $row_colour)."'>",'',0,1),'width'=>$width,'color'=>$link_color);
|
||||
unset($port);
|
||||
}
|
||||
|
||||
$node_devices = array_merge($tmp_devices,$mac_devices);
|
||||
|
Reference in New Issue
Block a user