Ensure IP addresses w/o MAC addresses are also shown and that already added clients are hidden.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-05-13 22:59:28 +02:00
parent bdca8104e5
commit 68b99658ad
2 changed files with 13 additions and 10 deletions

View File

@@ -216,7 +216,7 @@ if ($_POST['action'] == 'get_groups') {
// Loop over results
$ips = array();
while ($res = $query->fetchArray(SQLITE3_ASSOC)) {
$ips[$res['hwaddr']] = $res['name'] !== null ? $res['name'] : '';
$ips[strtoupper($res['hwaddr'])] = $res['name'] !== null ? $res['name'] : '';
}
$FTLdb->close();
@@ -227,8 +227,11 @@ if ($_POST['action'] == 'get_groups') {
// Loop over results, remove already configured clients
while (($res = $query->fetchArray(SQLITE3_ASSOC)) !== false) {
if (isset($ips[$res['hwaddr']])) {
unset($ips[$res['hwaddr']]);
if (isset($ips[$res['ip']])) {
unset($ips[$res['ip']]);
}
if (isset($ips["IP-".$res['ip']])) {
unset($ips["IP-".$res['ip']]);
}
}