From 754c0b0507e181290fc715d5ae003006b716ff5d Mon Sep 17 00:00:00 2001 From: laf Date: Thu, 17 Jul 2014 20:43:13 +0100 Subject: [PATCH] Fixed some scrutinizer issues --- includes/api_functions.inc.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/includes/api_functions.inc.php b/includes/api_functions.inc.php index 787f9e3174..db524939b8 100644 --- a/includes/api_functions.inc.php +++ b/includes/api_functions.inc.php @@ -189,6 +189,7 @@ function get_graph_by_id() global $config; $app = \Slim\Slim::getInstance(); $router = $app->router()->getCurrentRoute()->getParams(); + $vars = array(); $vars['id'] = $router['id']; $vars['type'] = $router['type'] ?: 'port_bits'; if(!empty($router['from'])) @@ -213,6 +214,7 @@ function get_graph_by_port() $app = \Slim\Slim::getInstance(); $router = $app->router()->getCurrentRoute()->getParams(); $device_id = $router['id']; + $vars = array(); $vars['port'] = $router['port']; $vars['type'] = $router['type'] ?: 'port_bits'; if(!empty($router['from'])) @@ -238,6 +240,7 @@ function get_graph_by_port_hostname() $app = \Slim\Slim::getInstance(); $router = $app->router()->getCurrentRoute()->getParams(); $hostname = $router['hostname']; + $vars = array(); $vars['port'] = $router['port']; $vars['type'] = $router['type'] ?: 'port_bits'; if(!empty($router['from'])) @@ -289,6 +292,7 @@ function get_graph_generic_by_deviceid() global $config; $app = \Slim\Slim::getInstance(); $router = $app->router()->getCurrentRoute()->getParams(); + $vars = array(); $vars['device'] = $router['id']; $vars['type'] = $router['type'] ?: 'port_bits'; if(!empty($router['from'])) @@ -313,7 +317,8 @@ function get_graph_generic_by_hostname() $app = \Slim\Slim::getInstance(); $router = $app->router()->getCurrentRoute()->getParams(); $hostname = $router['hostname']; - $vars['type'] = $router['type'] ?: 'port_bits'; + $vars = array(); + $vars['type'] = $router['type'] ?: 'port_bits'; if(!empty($router['from'])) { $vars['from'] = $router['from']; @@ -366,6 +371,11 @@ function list_devices() { $sql = "disabled='1'"; } + else + { + $sql = "1"; + } + $devices = array(); foreach (dbFetchRows("SELECT * FROM `devices` WHERE $sql ORDER by $order") as $device) { $devices[] = $device; @@ -431,7 +441,7 @@ function add_device() } else { - $messge = "Failed adding $hostname"; + $message = "Failed adding $hostname"; } }