servnest/public/ns/ns.php

30 lines
840 B
PHP

<?php require "../../common/top.php"; ?>
<form method="post">
<?php require "../../form.ns.php"; ?>
<br>
<label for="ns">Serveur de nom</label>
<br>
<input id="ns" placeholder="ns1.<?= CONF['common']['domain_example'] ?>" name="ns" type="text">
<br>
<input value="Procéder" type="submit">
</form>
<?php
if (nsCommonRequirements()
AND isset($_POST['ns'])
) {
$values = nsParseCommonRequirements();
checkAbsoluteDomainFormat($_POST['ns']);
exec(CONF['ns']['knotc_path'] . " zone-begin " . $_POST['zone']);
exec(CONF['ns']['knotc_path'] . " zone-" . $values['action'] . "set " . $_POST['zone'] . " " . $values['domain'] . " " . $values['ttl'] . " IN NS " . $_POST['ns']);
exec(CONF['ns']['knotc_path'] . " zone-commit " . $_POST['zone']);
echo "Enregistrement ajouté";
}
?>
<?php require "../../common/bottom.php"; ?>