Change zone deletion steps order

This commit is contained in:
Miraty 2022-04-23 18:55:39 +02:00
parent af99877e51
commit 6a50bc07a7

View file

@ -63,17 +63,17 @@ if (isset($_POST['zone']) AND isset($_SESSION['username'])) {
nsCheckZonePossession($_POST['zone']);
// Remove Knot zone file
unlink(KNOT_ZONES_PATH . "/" . $_POST['zone'] . "zone");
// Remove Knot tied data
exec(KNOTC_PATH . " zone-purge" . $_POST['zone']);
// Remove from Knot configuration
exec(KNOTC_PATH . " conf-begin");
exec(KNOTC_PATH . " conf-unset 'zone[" . $_POST['zone'] . "]'");
exec(KNOTC_PATH . " conf-commit");
// Remove Knot zone file
unlink(KNOT_ZONES_PATH . "/" . $_POST['zone'] . "zone");
// Remove Knot related data
exec(KNOTC_PATH . " zone-purge " . $_POST['zone']);
// Remove from Niver's database
$db = new PDO('sqlite:' . DB_PATH);
$stmt = $db->prepare("DELETE FROM zones WHERE zone = :zone AND username = :username");