add_web.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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/web/">
  6. <i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
  7. </a>
  8. </div>
  9. <div class="toolbar-buttons">
  10. <?php if (($user_plain == "admin" && $_GET["accept"] === "true") || $user_plain !== "admin") { ?>
  11. <button type="submit" class="button" form="vstobjects">
  12. <i class="fas fa-floppy-disk icon-purple"></i><?= _("Save") ?>
  13. </button>
  14. <?php } ?>
  15. </div>
  16. </div>
  17. </div>
  18. <!-- End toolbar -->
  19. <div class="container animate__animated animate__fadeIn">
  20. <form id="vstobjects" name="v_add_web" method="post" class="js-enable-inputs-on-submit">
  21. <input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
  22. <input type="hidden" name="ok" value="Add">
  23. <div class="form-container">
  24. <h1 class="form-title"><?= _("Add Web Domain") ?></h1>
  25. <?php show_alert_message($_SESSION); ?>
  26. <?php if ($user_plain == "admin" && $accept !== "true") { ?>
  27. <div class="alert alert-danger" role="alert">
  28. <i class="fas fa-exclamation"></i>
  29. <p><?= htmlify_trans(sprintf(_("It is strongly advised to {create a standard user account} before adding %s to the server due to the increased privileges the admin account possesses and potential security risks."), _('a web domain')), '</a>', '<a href="/add/user/">'); ?></p>
  30. </div>
  31. <?php } ?>
  32. <?php if ($user_plain == "admin" && empty($accept)) { ?>
  33. <div class="u-side-by-side u-pt18">
  34. <a href="/add/user/" class="button u-width-full u-mr10"><?= _("Add User") ?></a>
  35. <a href="/add/web/?accept=true" class="button button-danger u-width-full u-ml10"><?= _("Continue") ?></a>
  36. </div>
  37. <?php } ?>
  38. <?php if (($user_plain == "admin" && $accept === "true") || $user_plain !== "admin") { ?>
  39. <div class="u-mb10">
  40. <label for="v_domain" class="form-label"><?= _("Domain") ?></label>
  41. <input type="text" class="form-control" name="v_domain" id="v_domain" value="<?= htmlentities(trim($v_domain, "'")) ?>" required>
  42. </div>
  43. <div class="u-mb20">
  44. <label for="v_ip" class="form-label"><?= _("IPV4 Address") ?></label>
  45. <select class="form-select" name="v_ip" id="v_ip">
  46. <option value="">clear</option>
  47. <?php
  48. foreach ($ips as $ip => $value) {
  49. if ($value['VERSION']==4) {
  50. $display_ip = htmlentities(empty($value['NAT']) ? $ip : "{$value['NAT']}");
  51. $ip_selected = (!empty($v_ip) && $ip == $_POST['v_ip']) ? 'selected' : '';
  52. echo "\t\t\t\t<option value=\"{$ip}\" {$ip_selected}>{$display_ip}</option>\n";
  53. }
  54. }
  55. ?>
  56. </select>
  57. </div>
  58. <div class="u-mb20">
  59. <label for="v_ipv6" class="form-label"><?= _("IPV6 Address") ?></label>
  60. <select class="form-select" name="v_ipv6" id="v_ipv6">
  61. <option value="">clear</option>
  62. <?php
  63. foreach ($ips as $ipv6 => $value) {
  64. if ($value['VERSION']==6) {
  65. $display_ipv6 = $ipv6;
  66. $ipv6_selected = (!empty($v_ipv6) && $ipv6 == $_POST['v_ipv6']) ? 'selected' : '';
  67. echo "\t\t\t\t<option value=\"{$ipv6}\" {$ipv6_selected}>{$display_ipv6}</option>\n";
  68. }
  69. }
  70. ?>
  71. </select>
  72. </div>
  73. <?php if (isset($_SESSION["DNS_SYSTEM"]) && !empty($_SESSION["DNS_SYSTEM"])) { ?>
  74. <?php if ($panel[$user_plain]["DNS_DOMAINS"] != "0") { ?>
  75. <div class="form-check u-mb10">
  76. <input class="form-check-input" type="checkbox" name="v_dns" id="v_dns" <?php if (empty($v_dns) && $panel[$user_plain]["DNS_DOMAINS"] != "0"); ?>>
  77. <label for="v_dns">
  78. <?= _("DNS Support") ?>
  79. </label>
  80. </div>
  81. <?php } ?>
  82. <?php } ?>
  83. <?php if (isset($_SESSION["IMAP_SYSTEM"]) && !empty($_SESSION["IMAP_SYSTEM"])) { ?>
  84. <?php if ($panel[$user_plain]["MAIL_DOMAINS"] != "0") { ?>
  85. <div class="form-check">
  86. <input class="form-check-input" type="checkbox" name="v_mail" id="v_mail" <?php if (empty($v_mail) && $panel[$user_plain]["MAIL_DOMAINS"] != "0"); ?>>
  87. <label for="v_mail">
  88. <?= _("Mail Support") ?>
  89. </label>
  90. </div>
  91. <?php } ?>
  92. <?php } ?>
  93. <?php } ?>
  94. </div>
  95. </form>
  96. </div>