glue.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. if (processForm()) {
  3. regCheckDomainPossession($_POST['suffix']);
  4. $domain = formatAbsoluteDomain(formatEndWithDot($_POST['subdomain']) . $_POST['suffix']);
  5. $record = checkIpFormat($_POST['ip']);
  6. knotcZoneExec(CONF['reg']['registry'], array(
  7. $domain,
  8. CONF['reg']['ttl'],
  9. $record,
  10. $_POST['ip']
  11. ));
  12. output(200, 'Glue ajouté/retiré.');
  13. }
  14. ?>
  15. <p>
  16. <?= linkToDocs('glue-record', 'Documentation sur le glue record'); ?>
  17. </p>
  18. <form method="post">
  19. <label for="action">Action</label>
  20. <select name="action" id="action">
  21. <option value="add">Ajouter</option>
  22. <option value="delete">Retirer</option>
  23. </select>
  24. <fieldset>
  25. <legend>Domaine</legend>
  26. <div class="elForm">
  27. <label for="subdomain">Sous-domaine</label>
  28. <br>
  29. <input required="" id="subdomain" placeholder="ns1" name="subdomain" type="text">
  30. </div>
  31. <div class="elForm">
  32. <label for="suffix">Domaine</label>
  33. <br>
  34. <select required="" name="suffix" id="suffix">
  35. <option value="" disabled="" selected="">---</option>
  36. <?php
  37. if (isset($_SESSION['username']))
  38. foreach(regListUserDomains($_SESSION['username']) as $suffix)
  39. echo ' <option value="' . $suffix . '">' . $suffix . '</option>' . LF;
  40. ?>
  41. </select>
  42. </div>
  43. </fieldset>
  44. <label for="ip">IP</label><br>
  45. <input required="" pattern="^[a-f0-9:.]+$" id="ip" name="ip" minlength="2" maxlength="39" size="40" type="text" placeholder="<?= PLACEHOLDER_IPV4 ?> ou <?= PLACEHOLDER_IPV6 ?>">
  46. <br>
  47. <input value="Valider" type="submit">
  48. </form>