diff --git a/html/includes/common/top-devices.inc.php b/html/includes/common/top-devices.inc.php index 9eb13229f..24e76c8cb 100644 --- a/html/includes/common/top-devices.inc.php +++ b/html/includes/common/top-devices.inc.php @@ -60,19 +60,19 @@ else { $common_output[] = '
| '.generate_device_link($result, shorthost($result['hostname'])).' | diff --git a/html/includes/common/top-interfaces.inc.php b/html/includes/common/top-interfaces.inc.php index b7bfe0241..563da5825 100644 --- a/html/includes/common/top-interfaces.inc.php +++ b/html/includes/common/top-interfaces.inc.php @@ -65,12 +65,13 @@ else { SELECT *, p.ifInOctets_rate + p.ifOutOctets_rate as total FROM ports as p, devices as d WHERE d.device_id = p.device_id - AND unix_timestamp() - p.poll_time < '.$interval_seconds.' + AND unix_timestamp() - p.poll_time < ? AND ( p.ifInOctets_rate > 0 OR p.ifOutOctets_rate > 0 ) ORDER BY total desc - LIMIT '.$interface_count.' + LIMIT ? '; + $params = array($interval_seconds, $interface_count); } else { $query = ' @@ -81,12 +82,13 @@ else { OR (`PP`.`user_id` = ? AND `PP`.`port_id` = `I`.`port_id` AND `I`.`device_id` = `d`.`device_id`)) AND d.device_id = I.device_id - AND unix_timestamp() - I.poll_time < '.$interval_seconds.' + AND unix_timestamp() - I.poll_time < ? AND ( I.ifInOctets_rate > 0 OR I.ifOutOctets_rate > 0 ) ORDER BY total desc - LIMIT '.$interface_count.' + LIMIT ? '; + $params = array($_SESSION['user_id'], $interval_seconds, $device_count); } $common_output[] = ' @@ -102,7 +104,7 @@ else {
| '.generate_device_link($result, shorthost($result['hostname'])).' |