From 2159fd48fe700987f70499c320d4e50cba0d8bf7 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Wed, 18 Feb 2015 21:31:01 +0000 Subject: [PATCH] Updated files pointing to invalid tables --- html/pages/device.inc.php | 4 +--- html/pages/device/accesspoints.inc.php | 2 +- includes/common.php | 2 +- includes/polling/aruba-controller.inc.php | 8 ++++---- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index 3ab398d49f..467778ab29 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -60,8 +60,6 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) $health = dbFetchCell("SELECT COUNT(*) FROM storage WHERE device_id = '" . $device['device_id'] . "'") + dbFetchCell("SELECT COUNT(sensor_id) FROM sensors WHERE device_id = '" . $device['device_id'] . "'") + - dbFetchCell("SELECT COUNT(*) FROM cempMemPool WHERE device_id = '" . $device['device_id'] . "'") + - dbFetchCell("SELECT COUNT(*) FROM cpmCPU WHERE device_id = '" . $device['device_id'] . "'") + dbFetchCell("SELECT COUNT(*) FROM processors WHERE device_id = '" . $device['device_id'] . "'"); if ($health) @@ -127,7 +125,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) '); } - if (@dbFetchCell("SELECT COUNT(accesspoint_id) FROM accesspoint WHERE device_id = '" . $device['device_id'] . "'") > '0') + if (@dbFetchCell("SELECT COUNT(accesspoint_id) FROM access_points WHERE device_id = '" . $device['device_id'] . "'") > '0') { echo('
  • diff --git a/html/pages/device/accesspoints.inc.php b/html/pages/device/accesspoints.inc.php index 7040db70d2..e427626a5f 100644 --- a/html/pages/device/accesspoints.inc.php +++ b/html/pages/device/accesspoints.inc.php @@ -5,7 +5,7 @@ echo("
    "); foreach ($aps as $ap) { diff --git a/includes/common.php b/includes/common.php index 387cb09ad8..39de0bfd15 100644 --- a/includes/common.php +++ b/includes/common.php @@ -286,7 +286,7 @@ function device_by_name($name, $refresh = 0) function accesspoint_by_id($ap_id, $refresh = '0') { - $ap = dbFetchRow("SELECT * FROM `accesspoint` WHERE `accesspoint_id` = ?", array($ap_id)); + $ap = dbFetchRow("SELECT * FROM `access_points` WHERE `accesspoint_id` = ?", array($ap_id)); return $ap; diff --git a/includes/polling/aruba-controller.inc.php b/includes/polling/aruba-controller.inc.php index acb34d514d..8237a235c6 100644 --- a/includes/polling/aruba-controller.inc.php +++ b/includes/polling/aruba-controller.inc.php @@ -49,7 +49,7 @@ if ($device['type'] == 'wireless' && $device['os'] == 'arubaos') $graphs['wifi_clients'] = TRUE; - $ap_db = dbFetchRows("SELECT * FROM `accesspoint` WHERE `device_id` = ?", array($device['device_id'])); + $ap_db = dbFetchRows("SELECT * FROM `access_points` WHERE `device_id` = ?", array($device['device_id'])); foreach ($aruba_apnames as $key => $value) { @@ -122,9 +122,9 @@ if ($device['type'] == 'wireless' && $device['os'] == 'arubaos') if ($foundid==0) { - $ap_id = dbInsert(array('device_id' => $device['device_id'], 'name' => $name,'radio_number'=>$radionum, 'type'=>$type,'mac_addr'=>$mac,'channel'=>$channel,'txpow'=>$txpow,'radioutil'=>$radioutil,'numasoclients'=>$numasoclients,'nummonclients'=>$nummonclients,'numactbssid'=>$numactbssid,'nummonbssid'=>$nummonbssid,'interference'=>$interference), 'accesspoint'); + $ap_id = dbInsert(array('device_id' => $device['device_id'], 'name' => $name,'radio_number'=>$radionum, 'type'=>$type,'mac_addr'=>$mac,'channel'=>$channel,'txpow'=>$txpow,'radioutil'=>$radioutil,'numasoclients'=>$numasoclients,'nummonclients'=>$nummonclients,'numactbssid'=>$numactbssid,'nummonbssid'=>$nummonbssid,'interference'=>$interference), 'access_points'); } else { - dbUpdate(array('mac_addr' => $mac,'deleted'=>0,'channel'=>$channel,'txpow'=>$txpow,'radioutil'=>$radioutil,'numasoclients'=>$numasoclients,'nummonclients'=>$nummonclients,'numactbssid'=>$numactbssid,'nummonbssid'=>$nummonbssid,'interference'=>$interference), 'accesspoint', '`accesspoint_id` = ?', Array($foundid)); + dbUpdate(array('mac_addr' => $mac,'deleted'=>0,'channel'=>$channel,'txpow'=>$txpow,'radioutil'=>$radioutil,'numasoclients'=>$numasoclients,'nummonclients'=>$nummonclients,'numactbssid'=>$numactbssid,'nummonbssid'=>$nummonbssid,'interference'=>$interference), 'access_points', '`accesspoint_id` = ?', Array($foundid)); } @@ -134,7 +134,7 @@ if ($device['type'] == 'wireless' && $device['os'] == 'arubaos') //mark APs which are not on this controller anymore as deleted for ($z=0;$z1), 'accesspoint', '`accesspoint_id` = ?', Array($ap_db[$z]['accesspoint_id'])); + dbUpdate(array('deleted'=>1), 'access_points', '`accesspoint_id` = ?', Array($ap_db[$z]['accesspoint_id'])); }