servnest/public/reg/glue.php

60 lines
1.5 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>
<fieldset>
<legend>Domaine</legend>
<div class="elForm">
<label for="subdomain">Sous-domaine</label>
<br>
<input required="" id="subdomain" placeholder="ns1" name="subdomain" type="text">
</div>
<div class="elForm">
<label for="suffix">Domaine</label>
<br>
<select required="" name="suffix" id="suffix">
<option value="" disabled="" selected="">---</option>
2022-05-25 01:16:41 +02:00
<?php
2022-04-18 16:05:00 +02:00
2022-05-25 01:16:41 +02:00
if (isset($_SESSION['username']))
foreach(regListUserDomains($_SESSION['username']) as $suffix)
echo " <option value='" . $suffix . "'>." . $suffix . "</option>";
2022-04-18 16:05:00 +02:00
2022-05-25 01:16:41 +02:00
?>
2022-04-18 16:05:00 +02:00
</select>
</div>
</fieldset>
<label for="ip">IP</label><br>
2022-06-10 21:14:47 +02:00
<input required="" pattern="^[a-f0-9:.]+$" id="ip" name="ip" minlength="7" maxlength="39" size="40" type="text" placeholder="<?= PLACEHOLDER_IPV4 ?> ou <?= PLACEHOLDER_IPV6 ?>">
2022-04-18 16:05:00 +02:00
<br>
<input value="Valider" type="submit">
2021-02-17 22:48:49 +01:00
</form>
2022-07-20 20:03:45 +02:00
<p>
<?= linkToDocs('glue-record', 'Les glue records'); ?>
</p>
2021-02-17 22:48:49 +01:00
<?php
switchToFormProcess();
2021-08-05 14:04:33 +02:00
regCheckDomainPossession($_POST['suffix']);
2021-02-18 22:40:16 +01:00
2022-06-16 15:08:50 +02:00
$domain = formatAbsoluteDomain(formatEndWithDot($_POST['subdomain']) . $_POST['suffix']);
2021-02-17 22:48:49 +01:00
$record = checkIpFormat($_POST['ip']);
2021-02-17 22:48:49 +01:00
knotcZoneExec(CONF['reg']['registry'], array(
$domain,
CONF['reg']['ttl'],
$record,
$_POST['ip']
));
2022-05-25 01:16:41 +02:00
success("Glue record ajouté");