EPP now follows the registrar whitelist

This commit is contained in:
Pinga 2023-12-11 23:18:21 +02:00
parent 15618d44d3
commit 8ff945e475
2 changed files with 40 additions and 4 deletions

View file

@ -428,4 +428,19 @@ function dnssec_key2ds($owner, $flags, $protocol, $algorithm, $publickey) {
)
)
);
}
// Function to update the permitted IPs from the database
function updatePermittedIPs($pool, $permittedIPsTable) {
$pdo = $pool->get();
$query = "SELECT addr FROM registrar_whitelist";
$stmt = $pdo->query($query);
$permittedIPs = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
$pool->put($pdo);
// Clear the table and insert new values
$permittedIPsTable->truncate();
foreach ($permittedIPs as $ip) {
$permittedIPsTable->set($ip, ['addr' => $ip]);
}
}