edit_dns.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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="main-form">
  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="main-form" 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="u-mb20"><?= _("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"><?= _("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. <?php if ($_SESSION["DNS_CLUSTER_SYSTEM"] == "hestia-zone" && $_SESSION["SUPPORT_DNSSEC"] == "yes") { ?>
  65. <div class="form-check u-mb10">
  66. <input class="form-check-input" type="checkbox" name="v_dnssec" id="v_dnssec" value="yes" <?php if ($v_dnssec === 'yes'){ echo ' checked'; } ?>>
  67. <label for="v_dnssec">
  68. <?= _("Enable DNSSEC") ?>
  69. </label>
  70. </div>
  71. <?php } ?>
  72. <div class="u-mb10">
  73. <label for="v_exp" class="form-label">
  74. <?= _("Expiration Date") ?><span class="optional">(<?= _("YYYY-MM-DD") ?>)</span>
  75. </label>
  76. <input type="text" class="form-control" name="v_exp" id="v_exp" value="<?= htmlentities(trim($v_exp, "'")) ?>">
  77. </div>
  78. <div class="u-mb10">
  79. <label for="v_soa" class="form-label"><?= _("SOA") ?></label>
  80. <input type="text" class="form-control" name="v_soa" id="v_soa" value="<?= htmlentities(trim($v_soa, "'")) ?>">
  81. </div>
  82. <div class="u-mb10">
  83. <label for="v_ttl" class="form-label"><?= _("TTL") ?></label>
  84. <input type="text" class="form-control" name="v_ttl" id="v_ttl" value="<?= htmlentities(trim($v_ttl, "'")) ?>">
  85. </div>
  86. </div>
  87. </form>
  88. </div>