edit_dns.php 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!-- Begin toolbar -->
  2. <div class="toolbar">
  3. <div class="toolbar-inner">
  4. <div class="toolbar-buttons">
  5. <a class="button button-secondary" id="btn-back" href="/list/dns/">
  6. <i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
  7. </a>
  8. </div>
  9. <div class="toolbar-buttons">
  10. <button type="submit" class="button" form="vstobjects">
  11. <i class="fas fa-floppy-disk icon-purple"></i><?= _("Save") ?>
  12. </button>
  13. </div>
  14. </div>
  15. </div>
  16. <!-- End toolbar -->
  17. <div class="container animate__animated animate__fadeIn">
  18. <form id="vstobjects" name="v_edit_dns" method="post" class="<?= $v_status ?>">
  19. <input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
  20. <input type="hidden" name="save" value="save">
  21. <div class="form-container">
  22. <h1 class="form-title"><?= _("Editing DNS Domain") ?></h1>
  23. <?php show_alert_message($_SESSION); ?>
  24. <div class="u-mb10">
  25. <label for="v_domain" class="form-label"><?= _("Domain") ?></label>
  26. <input type="text" class="form-control" name="v_domain" id="v_domain" value="<?= htmlentities(trim($v_domain, "'")) ?>" disabled>
  27. <input type="hidden" name="v_domain" value="<?= htmlentities(trim($v_domain, "'")) ?>">
  28. </div>
  29. <div class="u-mb10">
  30. <label for="v_ip" class="form-label"><?= _("IP address") ?></label>
  31. <div class="u-pos-relative">
  32. <select class="form-select" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
  33. <option value="">clear</option>
  34. <?php
  35. foreach ($v_ips as $ip => $value) {
  36. $display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
  37. $ip_selected = ((!empty($v_ip) && ($v_ip==$ip||$v_ip==$display_ip) ))? 'selected' : '';
  38. echo "<option value='{$display_ip}' {$ip_selected}>" . htmlentities($display_ip) . "</option>\n";
  39. }
  40. ?>
  41. </select>
  42. <input type="text" class="form-control list-editor" name="v_ip" id="v_ip" value="<?= htmlentities(trim($v_ip, "'")) ?>">
  43. </div>
  44. </div>
  45. <?php if ($_SESSION["userContext"] === "admin" || ($_SESSION["userContext"] === "user" && $_SESSION["POLICY_USER_EDIT_DNS_TEMPLATES"] === "yes")) { ?>
  46. <div class="u-mb10">
  47. <label for="v_template" class="form-label">
  48. <?= _("Template") . "<span class='optional'>" . strtoupper($_SESSION["DNS_SYSTEM"]) . "</span>" ?>
  49. </label>
  50. <select class="form-select" name="v_template" id="v_template">
  51. <?php
  52. foreach ($templates as $key => $value) {
  53. echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
  54. $svalue = "'".$value."'";
  55. if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
  56. echo ' selected' ;
  57. }
  58. echo ">".htmlentities($value)."</option>\n";
  59. }
  60. ?>
  61. </select>
  62. </div>
  63. <?php } ?>
  64. <div class="form-check u-mb10">
  65. <input class="form-check-input" type="checkbox" name="v_dnssec" id="v_dnssec" value="yes" <?php if($v_dnssec === 'yes'){ echo ' checked'; } ?>>
  66. <label for="v_dnssec">
  67. <?= _("Enable DNSSEC") ?>
  68. </label>
  69. </div>
  70. <div class="u-mb10">
  71. <label for="v_exp" class="form-label">
  72. <?= _("Expiration Date") ?><span class="optional">(<?= _("YYYY-MM-DD") ?>)</span>
  73. </label>
  74. <input type="text" class="form-control" name="v_exp" id="v_exp" value="<?= htmlentities(trim($v_exp, "'")) ?>">
  75. </div>
  76. <div class="u-mb10">
  77. <label for="v_soa" class="form-label"><?= _("SOA") ?></label>
  78. <input type="text" class="form-control" name="v_soa" id="v_soa" value="<?= htmlentities(trim($v_soa, "'")) ?>">
  79. </div>
  80. <div class="u-mb10">
  81. <label for="v_ttl" class="form-label"><?= _("TTL") ?></label>
  82. <input type="text" class="form-control" name="v_ttl" id="v_ttl" value="<?= htmlentities(trim($v_ttl, "'")) ?>">
  83. </div>
  84. </div>
  85. </form>
  86. </div>