api: Limit get_graph_by_port_hostname() to one port and exclude deleted (#5936)

This commit is contained in:
Arjit Chaudhary
2017-02-18 02:49:15 +05:30
committed by Neil Lathwood
parent 1140be1a01
commit debb945477

View File

@ -71,7 +71,7 @@ function get_graph_by_port_hostname()
$vars['width'] = $_GET['width'] ?: 1075;
$vars['height'] = $_GET['height'] ?: 300;
$auth = '1';
$vars['id'] = dbFetchCell("SELECT `P`.`port_id` FROM `ports` AS `P` JOIN `devices` AS `D` ON `P`.`device_id` = `D`.`device_id` WHERE `D`.`hostname`=? AND `P`.`$port`=?", array($hostname, $vars['port']));
$vars['id'] = dbFetchCell("SELECT `P`.`port_id` FROM `ports` AS `P` JOIN `devices` AS `D` ON `P`.`device_id` = `D`.`device_id` WHERE `D`.`hostname`=? AND `P`.`$port`=? AND `deleted` = 0 LIMIT 1", array($hostname, $vars['port']));
$app->response->headers->set('Content-Type', 'image/png');
rrdtool_initialize(false);
include 'includes/graphs/graph.inc.php';