servnest/public/reg/ns.php

46 lines
1.1 KiB
PHP
Raw Normal View History

<?php require "../../common/html.php"; ?>
2021-01-22 21:58:46 +01:00
2021-02-17 22:48:49 +01:00
<form method="post">
2022-04-18 16:05:00 +02:00
<label for="action">Action</label>
<select name="action" id="action">
<option value="add">Ajouter</option>
<option value="delete">Retirer</option>
</select>
<br>
<label for="domain">Domaine</label>
<br>
<select required="" name="domain" id="domain">
<option value="" disabled="" selected="">---</option>
<?php
if (isset($_SESSION['username']))
foreach(regListUserDomains($_SESSION['username']) as $suffix)
echo " <option value='" . $suffix . "'>." . $suffix . "</option>\n";
?>
2021-01-22 21:58:46 +01:00
2022-04-18 16:05:00 +02:00
</select>
<br>
<label for="ns">Serveur de nom</label>
<br>
<input id="ns" placeholder="ns1.<?= CONF['common']['domain_example'] ?>." name="ns" type="text">
2022-04-18 16:05:00 +02:00
<br>
<input value="Valider" type="submit">
2021-02-17 22:48:49 +01:00
</form>
<?php
switchToFormProcess();
2021-02-17 22:48:49 +01:00
regCheckDomainPossession($_POST['domain']);
checkAbsoluteDomainFormat($_POST['ns']);
2021-02-17 22:48:49 +01:00
$suffix = regGetUpperDomain($_POST['domain']);
2021-02-19 13:23:26 +01:00
knotcExec($suffix, array(
$_POST['domain'],
CONF['reg']['ttl'],
"NS",
$_POST['ns']
));
2021-01-22 21:58:46 +01:00
success("Modification effectuée avec succès");