diff --git a/includes/functions.inc b/includes/functions.inc index c0dfb2ec..c48e007b 100644 --- a/includes/functions.inc +++ b/includes/functions.inc @@ -3597,12 +3597,8 @@ class endpointmanager { } //Find out if endpoint has already been configured for this mac address - $epm_sql = "SELECT * FROM endpointman_mac_list WHERE mac LIKE '%" . $mac_strip . "%'"; - $epm_row = $this->eda->sql($epm_sql, 'getRow', DB_FETCHMODE_ASSOC); - - $res = $this->eda->sql($epm_sql); - - $epm = count($res) ? TRUE : FALSE; + $count_sql = "SELECT count(*) FROM endpointman_mac_list WHERE mac LIKE '%" . $mac_strip . "%'"; + $epm = $this->eda->sql($count_sql, 'getOne'); //Add into a final array $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) { //ob_flush(); endpointman_flush_buffers(); return $length; -} \ No newline at end of file +}