srv.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. if (processForm()) {
  3. $values = nsParseCommonRequirements();
  4. if (!($_POST['priority'] >= 0 AND $_POST['priority'] <= 65535))
  5. output(403, 'Wrong value for <code>priority</code>.');
  6. if (!($_POST['weight'] >= 0 AND $_POST['weight'] <= 65535))
  7. output(403, 'Wrong value for <code>weight</code>.');
  8. if (!($_POST['port'] >= 0 AND $_POST['port'] <= 65535))
  9. output(403, 'Wrong value for <code>port</code>.');
  10. $_POST['target'] = formatAbsoluteDomain($_POST['target']);
  11. knotcZoneExec($_POST['zone'], array(
  12. $values['domain'],
  13. $values['ttl'],
  14. 'SRV',
  15. $_POST['priority'],
  16. $_POST['weight'],
  17. $_POST['port'],
  18. $_POST['target']
  19. ));
  20. output(200, 'Enregistrement ajouté/retiré.');
  21. }
  22. ?>
  23. <p>
  24. <?= linkToDocs('record-srv', 'Documentation du type d\'enregistrement SRV') ?>
  25. </p>
  26. <form method="post">
  27. <?php require 'form.ns.php'; ?>
  28. <br>
  29. <label for="priority">Priorité</label>
  30. <br>
  31. <input id="priority" min="0" max="65535" value="0" placeholder="0" name="priority" type="number">
  32. <br>
  33. <label for="weight">Poids</label>
  34. <br>
  35. <input id="weight" min="0" max="65535" value="0" placeholder="0" name="weight" type="number">
  36. <br>
  37. <label for="port">Port</label>
  38. <br>
  39. <input id="port" min="0" max="65535" placeholder="32768" name="port" type="number">
  40. <br>
  41. <label for="target">Cible</label>
  42. <br>
  43. <input id="target" minlenght="1" maxlength="128" placeholder="service.<?= PLACEHOLDER_DOMAIN ?>." name="target" type="text">
  44. <br>
  45. <input value="Valider" type="submit">
  46. </form>