2021-03-02 21:56:38 +00:00
|
|
|
<?php include "../top.inc.php"; ?>
|
|
|
|
|
|
|
|
<form method="post">
|
|
|
|
|
2021-05-16 14:55:39 +00:00
|
|
|
<?php require "../inc/form/form.ns.inc.php"; ?>
|
2021-03-02 21:56:38 +00:00
|
|
|
|
|
|
|
<br>
|
|
|
|
<label for="flag">Flag</label>
|
|
|
|
<br>
|
|
|
|
<input id="flag" min="0" max="127" placeholder="0" name="flag" type="number">
|
|
|
|
<br>
|
|
|
|
<label for="tag">Tag</label>
|
|
|
|
<br>
|
|
|
|
<input id="tag" minlenght="1" maxlength="128" pattern="^[a-z]{1,128}$" placeholder="issue" name="tag" type="text">
|
|
|
|
<br>
|
|
|
|
<label for="value">Valeur</label>
|
|
|
|
<br>
|
|
|
|
<input id="value" minlenght="3" maxlength="1024" pattern="^[a-z0-9.-]{3,1024}$" placeholder="letsencrypt.org" name="value" type="text">
|
|
|
|
<br>
|
|
|
|
<input value="Valider" type="submit">
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
2021-05-16 14:55:39 +00:00
|
|
|
if (nsCommonRequirements()
|
|
|
|
AND isset($_POST['flag'])
|
|
|
|
AND isset($_POST['tag'])
|
|
|
|
AND isset($_POST['value'])
|
|
|
|
) {
|
|
|
|
|
|
|
|
$values = nsParseCommonRequirements();
|
2021-03-02 21:56:38 +00:00
|
|
|
|
|
|
|
if (!($_POST['flag'] >= 0 AND $_POST['flag'] <= 255))
|
|
|
|
exit("ERROR: Wrong value for flag");
|
|
|
|
|
|
|
|
if (!(preg_match("/^[a-z]{1,127}$/", $_POST['tag'])))
|
|
|
|
exit("ERROR: Wrong value for tag");
|
|
|
|
|
|
|
|
if (!(preg_match("/^[a-z0-9.-]{1,255}$/", $_POST['value'])))
|
|
|
|
exit("ERROR: Wrong value for value");
|
|
|
|
|
|
|
|
exec(KNOTC_PATH . " zone-begin " . $_POST['zone']);
|
2021-07-15 13:36:34 +00:00
|
|
|
exec(KNOTC_PATH . " zone-" . $values['action'] . "set " . $_POST['zone'] . " " . $values['domain'] . " " . $values['ttl'] . " IN CAA " . $_POST['flag'] . " " . $_POST['tag'] . " " . $_POST['value']);
|
2021-03-02 21:56:38 +00:00
|
|
|
exec(KNOTC_PATH . " zone-commit " . $_POST['zone']);
|
|
|
|
echo "Enregistrement ajouté";
|
|
|
|
}
|
|
|
|
|
2021-05-16 14:55:39 +00:00
|
|
|
|
|
|
|
|
2021-03-02 21:56:38 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<?php include "../bottom.inc.php"; ?>
|