Skip to content

Commit 68f62cf

Browse files
authored
Fixed "no devices found" error.
1 parent 7ee3571 commit 68f62cf

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

includes/functions.inc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3597,12 +3597,8 @@ class endpointmanager {
35973597
}
35983598

35993599
//Find out if endpoint has already been configured for this mac address
3600-
$epm_sql = "SELECT * FROM endpointman_mac_list WHERE mac LIKE '%" . $mac_strip . "%'";
3601-
$epm_row = $this->eda->sql($epm_sql, 'getRow', DB_FETCHMODE_ASSOC);
3602-
3603-
$res = $this->eda->sql($epm_sql);
3604-
3605-
$epm = count($res) ? TRUE : FALSE;
3600+
$count_sql = "SELECT count(*) FROM endpointman_mac_list WHERE mac LIKE '%" . $mac_strip . "%'";
3601+
$epm = $this->eda->sql($count_sql, 'getOne');
36063602

36073603
//Add into a final array
36083604
$final[$z] = array("ip" => $ip, "mac" => $mac, "mac_strip" => $mac_strip, "oui" => $oui, "brand" => $brand['name'], "brand_id" => $brand['id'], "endpoint_managed" => $epm);
@@ -3896,4 +3892,4 @@ function endpointmanager_read_body($ch, $string) {
38963892
//ob_flush();
38973893
endpointman_flush_buffers();
38983894
return $length;
3899-
}
3895+
}

0 commit comments

Comments
 (0)