This commit is contained in:
Pinga 2023-12-11 23:33:16 +02:00
parent 8ff945e475
commit bc3a55d6b4

View file

@ -438,8 +438,12 @@ function updatePermittedIPs($pool, $permittedIPsTable) {
$permittedIPs = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
$pool->put($pdo);
// Clear the table and insert new values
$permittedIPsTable->truncate();
// Manually clear the table by removing each entry
foreach ($permittedIPsTable as $key => $value) {
$permittedIPsTable->del($key);
}
// Insert new values
foreach ($permittedIPs as $ip) {
$permittedIPsTable->set($ip, ['addr' => $ip]);
}