|
@@ -58,18 +58,14 @@ function nsCheckZonePossession($zone) {
|
|
|
}
|
|
|
|
|
|
function nsDeleteZone($zone) {
|
|
|
- // Remove from Knot configuration
|
|
|
- knotcConfExec(["unset 'zone[$zone]'"]);
|
|
|
-
|
|
|
- // Remove Knot zone file
|
|
|
- if (unlink(CONF['ns']['knot_zones_path'] . '/' . $zone . 'zone') !== true)
|
|
|
- output(500, 'Failed to remove Knot zone file.');
|
|
|
-
|
|
|
- // Remove Knot related data
|
|
|
+ // Delete zone data
|
|
|
exec(CONF['dns']['knotc_path'] . ' --force zone-purge ' . $zone, result_code: $code);
|
|
|
if ($code !== 0)
|
|
|
output(500, 'Failed to purge zone data.');
|
|
|
|
|
|
+ // Remove from Knot configuration
|
|
|
+ knotcConfExec(["unset 'zone[$zone]'"]);
|
|
|
+
|
|
|
// Remove from database
|
|
|
query('delete', 'zones', [
|
|
|
'zone' => $zone,
|