|
@@ -14,7 +14,7 @@
|
|
|
|
|
|
<label for="host">Hôte</label>
|
|
<label for="host">Hôte</label>
|
|
<br>
|
|
<br>
|
|
- <input id="host" minlenght="1" maxlength="128" placeholder="mail.exemple." name="host" type="text">
|
|
|
|
|
|
+ <input id="host" placeholder="mail.exemple." name="host" type="text">
|
|
|
|
|
|
<br>
|
|
<br>
|
|
<input value="Valider" type="submit">
|
|
<input value="Valider" type="submit">
|
|
@@ -24,9 +24,7 @@
|
|
|
|
|
|
if (nsCommonRequirements()
|
|
if (nsCommonRequirements()
|
|
AND isset($_POST['priority'])
|
|
AND isset($_POST['priority'])
|
|
- AND isset($_POST['weight'])
|
|
|
|
- AND isset($_POST['port'])
|
|
|
|
- AND isset($_POST['target'])
|
|
|
|
|
|
+ AND isset($_POST['host'])
|
|
) {
|
|
) {
|
|
|
|
|
|
$values = nsParseCommonRequirements();
|
|
$values = nsParseCommonRequirements();
|
|
@@ -34,16 +32,10 @@ if (nsCommonRequirements()
|
|
if (!($_POST['priority'] >= 0 AND $_POST['priority'] <= 255))
|
|
if (!($_POST['priority'] >= 0 AND $_POST['priority'] <= 255))
|
|
exit("ERROR: Wrong value for priority");
|
|
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']);
|
|
|
|
|
|
+ checkAbsoluteDomainFormat($_POST['host']);
|
|
|
|
|
|
exec(KNOTC_PATH . " zone-begin " . $_POST['zone']);
|
|
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-" . $values['action'] . "set " . $_POST['zone'] . " " . $_POST['domain'] . " " . $values['ttl'] . " IN MX " . $_POST['priority'] . " " . $_POST['host']);
|
|
exec(KNOTC_PATH . " zone-commit " . $_POST['zone']);
|
|
exec(KNOTC_PATH . " zone-commit " . $_POST['zone']);
|
|
echo "Enregistrement ajouté";
|
|
echo "Enregistrement ajouté";
|
|
}
|
|
}
|