servnest/public/ns/mx.php

43 lines
850 B
PHP
Raw Normal View History

<?php require "../../common/html.php"; ?>
2021-05-16 16:55:39 +02:00
<form method="post">
<?php require "../../form.ns.php"; ?>
2021-05-16 16:55:39 +02:00
2022-04-18 16:05:00 +02:00
<br>
2021-05-16 16:55:39 +02:00
2022-04-18 16:05:00 +02:00
<label for="priority">Priorité</label>
<br>
<input id="priority" min="0" max="65535" value="0" placeholder="0" name="priority" type="number">
2021-05-16 16:55:39 +02:00
2022-04-18 16:05:00 +02:00
<br>
2021-05-16 16:55:39 +02:00
2022-04-18 16:05:00 +02:00
<label for="host">Hôte</label>
<br>
2022-06-10 21:14:47 +02:00
<input id="host" placeholder="mail.<?= PLACEHOLDER_DOMAIN ?>." name="host" type="text">
2021-05-16 16:55:39 +02:00
2022-04-18 16:05:00 +02:00
<br>
<input value="Valider" type="submit">
2021-05-16 16:55:39 +02:00
</form>
<?php
switchToFormProcess();
2021-05-16 16:55:39 +02:00
$values = nsParseCommonRequirements();
2021-05-16 16:55:39 +02:00
if (!($_POST['priority'] >= 0 AND $_POST['priority'] <= 255))
userError("Wrong value for <code>priority</code>.");
2021-05-16 16:55:39 +02:00
$_POST['host'] = formatAbsoluteDomain($_POST['host']);
2021-05-16 16:55:39 +02:00
knotcZoneExec($_POST['zone'], array(
$values['domain'],
$values['ttl'],
"MX",
$_POST['priority'],
$_POST['host']
));
2022-05-25 01:16:41 +02:00
success("Enregistrement ajouté");