51 lines
954 B
PHP
51 lines
954 B
PHP
<?php require "../../common/html.php"; ?>
|
|
|
|
<form method="post">
|
|
|
|
<?php require "../../form.ns.php"; ?>
|
|
|
|
<br>
|
|
|
|
<label for="priority">Priorité</label>
|
|
<br>
|
|
<input id="priority" min="0" max="65535" value="0" placeholder="0" name="priority" type="number">
|
|
|
|
<br>
|
|
|
|
<label for="host">Hôte</label>
|
|
<br>
|
|
<input id="host" placeholder="mail.<?= CONF['common']['domain_example'] ?>." name="host" type="text">
|
|
|
|
<br>
|
|
<input value="Valider" type="submit">
|
|
</form>
|
|
|
|
<?php
|
|
|
|
if (nsCommonRequirements()
|
|
AND isset($_POST['priority'])
|
|
AND isset($_POST['host'])
|
|
) {
|
|
|
|
$values = nsParseCommonRequirements();
|
|
|
|
if (!($_POST['priority'] >= 0 AND $_POST['priority'] <= 255))
|
|
userError("Wrong value for <code>priority</code>.");
|
|
|
|
checkAbsoluteDomainFormat($_POST['host']);
|
|
|
|
knotcExec($_POST['zone'], array(
|
|
$values['domain'],
|
|
$values['ttl'],
|
|
"MX",
|
|
$_POST['priority'],
|
|
$_POST['host']
|
|
));
|
|
|
|
echo "Enregistrement ajouté";
|
|
}
|
|
|
|
?>
|
|
|
|
<?php closeHTML(); ?>
|