edit_dns.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!-- Begin toolbar -->
  2. <div class="toolbar">
  3. <div class="toolbar-inner">
  4. <div class="toolbar-buttons">
  5. <a class="button button-secondary button-back js-button-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"><?= _("Edit 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 required>
  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"><?= _("IPV4 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. if ($value['VERSION']==4) {
  37. $display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
  38. $ip_selected = ((!empty($v_ip) && ($v_ip==$ip||$v_ip==$display_ip) ))? 'selected' : '';
  39. echo "<option value='{$display_ip}' {$ip_selected}>" . htmlentities($display_ip) . "</option>\n";
  40. }
  41. }
  42. ?>
  43. </select>
  44. <input type="text" class="form-control list-editor" name="v_ip" id="v_ip" value="<?= htmlentities(trim($v_ip, "'")) ?>">
  45. </div>
  46. </div>
  47. <div class="u-mb10">
  48. <label for="v_ipv6" class="form-label"><?= _("IPV6 Address") ?></label>
  49. <div class="u-pos-relative">
  50. <select class="form-select" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
  51. <option value="">clear</option>
  52. <?php
  53. foreach ($v_ips as $ipv6 => $value) {
  54. if ($value['VERSION']==6) {
  55. $display_ipv6 = $ipv6;
  56. $ipv6_selected = ((!empty($v_ipv6) && ($v_ipv6==$ipv6||$v_ipv6==$display_ipv6) ))? 'selected' : '';
  57. echo "<option value='{$display_ipv6}' {$ipv6_selected}>" . htmlentities($display_ipv6) . "</option>\n";
  58. }
  59. }
  60. ?>
  61. </select>
  62. <input type="text" class="form-control list-editor" name="v_ipv6" id="v_ipv6" value="<?= htmlentities(trim($v_ipv6, "'")) ?>">
  63. </div>
  64. </div>
  65. <?php if ($_SESSION["userContext"] === "admin" || ($_SESSION["userContext"] === "user" && $_SESSION["POLICY_USER_EDIT_DNS_TEMPLATES"] === "yes")) { ?>
  66. <div class="u-mb10">
  67. <label for="v_template" class="form-label">
  68. <?= _("Template") . "<span class='optional'>" . strtoupper($_SESSION["DNS_SYSTEM"]) . "</span>" ?>
  69. </label>
  70. <select class="form-select" name="v_template" id="v_template">
  71. <?php
  72. foreach ($templates as $key => $value) {
  73. echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
  74. $svalue = "'".$value."'";
  75. if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
  76. echo ' selected' ;
  77. }
  78. echo ">".htmlentities($value)."</option>\n";
  79. }
  80. ?>
  81. </select>
  82. </div>
  83. <?php } ?>
  84. <?php if ($_SESSION["DNS_CLUSTER_SYSTEM"] == "hestia-zone" && $_SESSION["SUPPORT_DNSSEC"] == "yes") { ?>
  85. <div class="form-check u-mb10">
  86. <input class="form-check-input" type="checkbox" name="v_dnssec" id="v_dnssec" value="yes" <?php if($v_dnssec === 'yes'){ echo ' checked'; } ?>>
  87. <label for="v_dnssec">
  88. <?= _("Enable DNSSEC") ?>
  89. </label>
  90. </div>
  91. <?php } ?>
  92. <div class="u-mb10">
  93. <label for="v_exp" class="form-label">
  94. <?= _("Expiration Date") ?><span class="optional">(<?= _("YYYY-MM-DD") ?>)</span>
  95. </label>
  96. <input type="text" class="form-control" name="v_exp" id="v_exp" value="<?= htmlentities(trim($v_exp, "'")) ?>">
  97. </div>
  98. <div class="u-mb10">
  99. <label for="v_soa" class="form-label"><?= _("SOA") ?></label>
  100. <input type="text" class="form-control" name="v_soa" id="v_soa" value="<?= htmlentities(trim($v_soa, "'")) ?>">
  101. </div>
  102. <div class="u-mb10">
  103. <label for="v_ttl" class="form-label"><?= _("TTL") ?></label>
  104. <input type="text" class="form-control" name="v_ttl" id="v_ttl" value="<?= htmlentities(trim($v_ttl, "'")) ?>">
  105. </div>
  106. </div>
  107. </form>
  108. </div>