mirror of
https://github.com/pi-hole/web.git
synced 2026-04-27 04:04:00 +01:00
Remove fallback to ip column in network table as we removed this column in DB version 5. There will always be a corresponding entry for each device in the network table.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -73,17 +73,12 @@ if(isset($_GET["network"]) && $auth)
|
||||
while($results !== false && $res = $results->fetchArray(SQLITE3_ASSOC))
|
||||
{
|
||||
$id = $res["id"];
|
||||
// Backup IP column of this request in case we want to reuse it further down
|
||||
$resip = $res["ip"];
|
||||
// Empty array for holding the IP addresses
|
||||
$res["ip"] = array();
|
||||
// Get IP addresses for this device
|
||||
$ips = $db->query("SELECT ip FROM network_addresses WHERE network_id = $id ORDER BY lastSeen DESC");
|
||||
while($ips !== false && $ip = $ips->fetchArray(SQLITE3_ASSOC))
|
||||
$network_addresses = $db->query("SELECT ip FROM network_addresses WHERE network_id = $id ORDER BY lastSeen DESC");
|
||||
while($network_addresses !== false && $ip = $network_addresses->fetchArray(SQLITE3_ASSOC))
|
||||
array_push($res["ip"],$ip["ip"]);
|
||||
// If the network_addresses table does not contain any IPs for this client, we use the IP stored in the network table
|
||||
if(count($res["ip"]) < 1)
|
||||
array_push($res["ip"],$resip);
|
||||
array_push($network, $res);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user