From e637877ab36ad4e1f81e707c9e6417c28b6c1a5b Mon Sep 17 00:00:00 2001 From: Miraty Date: Fri, 10 Jun 2022 03:10:10 +0200 Subject: [PATCH] Add unregister.php --- common/pages.php | 3 +++ config.ini | 1 + public/reg/index.php | 4 ++++ public/reg/register.php | 2 +- public/reg/unregister.php | 42 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 public/reg/unregister.php diff --git a/common/pages.php b/common/pages.php index fdb3f0a..eecab92 100644 --- a/common/pages.php +++ b/common/pages.php @@ -53,6 +53,9 @@ switch (SERVICE) { case "register": $page['title'] = "Enregistrer un nouveau domaine"; break; + case "unregister": + $page['title'] = "Effacer un domaine"; + break; case "glue": $page['title'] = "Créer un Glue Record"; break; diff --git a/config.ini b/config.ini index c351e49..50f411c 100644 --- a/config.ini +++ b/config.ini @@ -14,6 +14,7 @@ knotc_path = "/usr/sbin/knotc" [reg] registry = niver.test. +registry_file = "/srv/ns/niver.test.zone" ttl = 86400 subdomain_regex = "^[a-z0-9]{4,63}$" diff --git a/public/reg/index.php b/public/reg/index.php index 95a8ee4..3534ff5 100644 --- a/public/reg/index.php +++ b/public/reg/index.php @@ -17,6 +17,10 @@
Indiquer les IP de ses serveurs de noms de son sous-domaine de dont les adresses se trouvent sur ce même sous-domaine
+
Effacer un nom de domaine
+
+ Effacer toutes les données d'un domaine +
diff --git a/public/reg/register.php b/public/reg/register.php index dd59c5b..5f2cd20 100644 --- a/public/reg/register.php +++ b/public/reg/register.php @@ -38,4 +38,4 @@ $stmt->bindParam(':last_renewal', $time); $stmt->execute(); -success("Modification effectuée avec succès"); +success("Domaine ajouté au registre."); diff --git a/public/reg/unregister.php b/public/reg/unregister.php new file mode 100644 index 0000000..9bc3235 --- /dev/null +++ b/public/reg/unregister.php @@ -0,0 +1,42 @@ + + +
+ +
+ +
+ +
+ +prepare("DELETE FROM registry WHERE domain = :domain AND username = :username"); + +$stmt->bindParam(':domain', $_POST['domain']); +$stmt->bindParam(':username', $_SESSION['username']); + +$stmt->execute(); + +success("Domaine effacé du registre.");