diff --git a/exe.php b/exe.php new file mode 100644 index 0000000..e1ed964 --- /dev/null +++ b/exe.php @@ -0,0 +1,14 @@ +Action + +
+ + +
+ + +
+ TTL + + + + + + +
+ + +
+ diff --git a/inc/ns.inc.php b/inc/ns.inc.php index 7c4755b..9a4c008 100644 --- a/inc/ns.inc.php +++ b/inc/ns.inc.php @@ -2,13 +2,30 @@ if (strpos($_SERVER['PHP_SELF'], "inc.php") !== false) exit("This file is meant to be included."); -function nsTtl($value, $multiplier) { - $ttl = $value * $multiplier; +function nsCommonRequirements() { + if (isset($_POST['action']) + AND isset($_POST['zone']) + AND isset($_POST['domain']) + AND isset($_POST['ttl-value']) + AND isset($_POST['ttl-multiplier']) + AND isset($_SESSION['username']) + ) { + return true; + } +} - if (!($ttl >= 300 AND $ttl <= 432000)) +function nsParseCommonRequirements() { + $values['action'] = checkAction($_POST['action']); + + nsCheckZonePossession($_POST['zone']); + checkAbsoluteDomainFormat($_POST['domain']); + + $values['ttl'] = $_POST['ttl-value'] * $_POST['ttl-multiplier']; + + if (!($values['ttl'] >= 300 AND $values['ttl'] <= 432000)) exit("Erreur : le TTL doit être compris entre 5 minutes et 5 jours (entre 300 et 432000 secondes)"); - return $ttl; + return $values; } function nsListUserZones($username) { diff --git a/inc/pages.inc.php b/inc/pages.inc.php index 592ac66..37d7f78 100644 --- a/inc/pages.inc.php +++ b/inc/pages.inc.php @@ -14,7 +14,7 @@ switch (SERVICE) { $page['title'] = "Obtenir les enregistrements DS"; break; case "ip": - $page['title'] = "Enregistrements A ou AAAA"; + $page['title'] = "Enregistrements A et AAAA"; break; case "ns": $page['title'] = "Enregistrement NS"; @@ -25,6 +25,12 @@ switch (SERVICE) { case "caa": $page['title'] = "Enregistrement CAA"; break; + case "srv": + $page['title'] = "Enregistrement SRV"; + break; + case "mx": + $page['title'] = "Enregistrement MX"; + break; case "zone": $page['title'] = "Ajouter une zone"; break; diff --git a/less/form.less b/less/form.less index cd1ec29..25a5ef4 100644 --- a/less/form.less +++ b/less/form.less @@ -10,7 +10,6 @@ form { input, select { border-radius: 12px; - height: 30px; font-size: @fontSize; margin: 5px; height: 100%; diff --git a/ns/caa.php b/ns/caa.php index ea7a60c..6b408dc 100644 --- a/ns/caa.php +++ b/ns/caa.php @@ -1,31 +1,9 @@
- - -
- -
- -
- -
- -
-

@@ -44,17 +22,13 @@ = 0 AND $_POST['flag'] <= 255)) exit("ERROR: Wrong value for flag"); @@ -65,19 +39,14 @@ if ( if (!(preg_match("/^[a-z0-9.-]{1,255}$/", $_POST['value']))) exit("ERROR: Wrong value for value"); - nsCheckZonePossession($_POST['zone']); - checkAbsoluteDomainFormat($_POST['domain']); - - $action = checkAction($_POST['action']); - - $ttl = nsTtl($_POST['ttl-value'], $_POST['ttl-multiplier']); - exec(KNOTC_PATH . " zone-begin " . $_POST['zone']); - exec(KNOTC_PATH . " zone-" . $action . "set " . $_POST['zone'] . " " . $_POST['domain'] . " " . $ttl . " IN CAA " . $_POST['flag'] . " " . $_POST['tag'] . " " . $_POST['value']); + exec(KNOTC_PATH . " zone-" . $values['action'] . "set " . $_POST['zone'] . " " . $_POST['domain'] . " " . $values['ttl'] . " IN CAA " . $_POST['flag'] . " " . $_POST['tag'] . " " . $_POST['value']); exec(KNOTC_PATH . " zone-commit " . $_POST['zone']); echo "Enregistrement ajouté"; } + + ?> diff --git a/ns/index.php b/ns/index.php index e02bc90..600c51e 100644 --- a/ns/index.php +++ b/ns/index.php @@ -21,10 +21,6 @@
Associer du texte à un domaine
-
Enregistrement TLSA
-
- Mettre en place DANE en indiquant l'empreinte d'un certificat TLS -
Enregistrement CAA
Indiquer les seules autorités de certifications autorisée à signer les domaines @@ -37,6 +33,11 @@
Indiquer le serveur mail pour un domaine
+ diff --git a/ns/ip.php b/ns/ip.php index 858dde0..468c527 100644 --- a/ns/ip.php +++ b/ns/ip.php @@ -9,45 +9,19 @@

- - +
-
- -
-
-
-
-
- -

+ +
+ + + +
+ + +
+ + +
+ + +
+ + +
+ +
+ += 0 AND $_POST['priority'] <= 255)) + exit("ERROR: Wrong value for priority"); + + if (!($_POST['weight'] >= 0 AND $_POST['weight'] <= 255)) + exit("ERROR: Wrong value for weight"); + + if (!($_POST['port'] >= 0 AND $_POST['port'] <= 65535)) + exit("ERROR: Wrong value for port"); + + checkAbsoluteDomainFormat($_POST['target']); + + exec(KNOTC_PATH . " zone-begin " . $_POST['zone']); + exec(KNOTC_PATH . " zone-" . $values['action'] . "set " . $_POST['zone'] . " " . $_POST['domain'] . " " . $values['ttl'] . " IN MX " . $_POST['priority'] . " " . $_POST['weight'] . " " . $_POST['port'] . " " . $_POST['target']); + exec(KNOTC_PATH . " zone-commit " . $_POST['zone']); + echo "Enregistrement ajouté"; +} + +?> + + diff --git a/ns/ns.php b/ns/ns.php index c2be49b..aa3e0aa 100644 --- a/ns/ns.php +++ b/ns/ns.php @@ -1,29 +1,7 @@
- - -
- -
- -
- -
- +

@@ -33,17 +11,16 @@
+ +
+ + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ +
+ += 0 AND $_POST['priority'] <= 65535)) + exit("ERROR: Wrong value for priority"); + + if (!($_POST['weight'] >= 0 AND $_POST['weight'] <= 65535)) + exit("ERROR: Wrong value for weight"); + + if (!($_POST['port'] >= 0 AND $_POST['port'] <= 65535)) + exit("ERROR: Wrong value for port"); + + checkAbsoluteDomainFormat($_POST['target']); + + exec(KNOTC_PATH . " zone-begin " . $_POST['zone']); + exec(KNOTC_PATH . " zone-" . $values['action'] . "set " . $_POST['zone'] . " " . $_POST['domain'] . " " . $values['ttl'] . " IN SRV " . $_POST['priority'] . " " . $_POST['weight'] . " " . $_POST['port'] . " " . $_POST['target']); + exec(KNOTC_PATH . " zone-commit " . $_POST['zone']); + echo "Enregistrement ajouté"; +} + +?> + + diff --git a/ns/txt.php b/ns/txt.php index 1c3af0d..4e598a3 100644 --- a/ns/txt.php +++ b/ns/txt.php @@ -1,29 +1,7 @@
- - -
- -
- -
- -
- +

@@ -33,22 +11,17 @@