add_mail.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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/mail/">
  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
  19. x-data="{
  20. hasSmtpRelay: <?= $v_smtp_relay == "true" ? "true" : "false" ?>
  21. }"
  22. id="main-form"
  23. name="v_add_mail"
  24. method="post"
  25. >
  26. <input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
  27. <input type="hidden" name="ok" value="Add">
  28. <div class="form-container">
  29. <h1 class="u-mb20"><?= _("Add Mail Domain") ?></h1>
  30. <?php show_alert_message($_SESSION); ?>
  31. <?php if ($user_plain == "admin" && $accept !== "true") { ?>
  32. <div class="alert alert-danger" role="alert">
  33. <i class="fas fa-exclamation"></i>
  34. <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 mail domain')), '</a>', '<a href="/add/user/">'); ?></p>
  35. </div>
  36. <?php } ?>
  37. <?php if ($user_plain == "admin" && empty($accept)) { ?>
  38. <div class="u-side-by-side u-mt20">
  39. <a href="/add/user/" class="button u-width-full u-mr10"><?= _("Add User") ?></a>
  40. <a href="/add/mail/?accept=true" class="button button-danger u-width-full u-ml10"><?= _("Continue") ?></a>
  41. </div>
  42. <?php } ?>
  43. <?php if (($user_plain == "admin" && $accept === "true") || $user_plain !== "admin") { ?>
  44. <div class="u-mb20">
  45. <label for="v_domain" class="form-label"><?= _("Domain") ?></label>
  46. <input type="text" class="form-control" name="v_domain" id="v_domain" value="<?= htmlentities(trim($v_domain, "'")) ?>" required>
  47. </div>
  48. <?php if ($_SESSION["WEBMAIL_SYSTEM"]) { ?>
  49. <div class="u-mb20">
  50. <label for="v_webmail" class="form-label"><?= _("Webmail Client") ?></label>
  51. <select class="form-select" name="v_webmail" id="v_webmail" tabindex="6">
  52. <?php foreach ($webmail_clients as $client){
  53. echo "\t\t\t\t<option value=\"".htmlentities($client)."\"";
  54. if (( $v_webmail == $client )) {
  55. echo ' selected' ;
  56. }
  57. echo ">".htmlentities(ucfirst($client))."</option>\n";
  58. }
  59. ?>
  60. <option value="" <?php if (empty($v_webmail) || $v_webmail == 'disabled' ){ echo "selected"; }?>><?= _("Disabled") ?></option>
  61. </select>
  62. </div>
  63. <?php } ?>
  64. <?php if (!empty($_SESSION["ANTISPAM_SYSTEM"])) { ?>
  65. <div class="form-check u-mb10">
  66. <input class="form-check-input" type="checkbox" name="v_antispam" id="v_antispam" <?php if ((empty($v_antispam)) || ($v_antispam == 'yes')) echo 'checked'; ?>>
  67. <label for="v_antispam">
  68. <?= _("Spam Filter") ?>
  69. </label>
  70. </div>
  71. <div class="form-check u-mb10">
  72. <input class="form-check-input" type="checkbox" name="v_reject" id="v_reject" <?php if ((empty($v_reject)) || ($v_reject == 'yes')) echo 'checked'; ?>>
  73. <label for="v_reject">
  74. <?= _("Reject Spam") ?>
  75. </label>
  76. </div>
  77. <?php } ?>
  78. <?php if (!empty($_SESSION['ANTIVIRUS_SYSTEM'])) { ?>
  79. <div class="form-check u-mb10">
  80. <input class="form-check-input" type="checkbox" name="v_antivirus" id="v_antivirus" <?php if ((empty($v_antivirus)) || ($v_antivirus == 'yes')) echo 'checked'; ?>>
  81. <label for="v_antivirus">
  82. <?= _("Anti-Virus") ?>
  83. </label>
  84. </div>
  85. <?php } ?>
  86. <div class="form-check u-mb10">
  87. <input class="form-check-input" type="checkbox" name="v_dkim" id="v_dkim" <?php if (isset($v_dkim)&&$v_dkim == 'yes') echo 'checked'; ?>>
  88. <label for="v_dkim">
  89. <?= _("DKIM Support") ?>
  90. </label>
  91. </div>
  92. <div class="form-check u-mb10">
  93. <input x-model="hasSmtpRelay" class="form-check-input" type="checkbox" name="v_smtp_relay" id="v_smtp_relay">
  94. <label for="v_smtp_relay">
  95. <?= _("SMTP Relay") ?>
  96. </label>
  97. </div>
  98. <div x-cloak x-show="hasSmtpRelay" id="smtp_relay_table" class="u-pl30">
  99. <div class="u-mb10">
  100. <label for="v_smtp_relay_host" class="form-label"><?= _("Host") ?></label>
  101. <input type="text" class="form-control" name="v_smtp_relay_host" id="v_smtp_relay_host" value="<?= htmlentities(trim($v_smtp_relay_host, "'")) ?>">
  102. </div>
  103. <div class="u-mb10">
  104. <label for="v_smtp_relay_port" class="form-label"><?= _("Port") ?></label>
  105. <input type="text" class="form-control" name="v_smtp_relay_port" id="v_smtp_relay_port" value="<?= htmlentities(trim($v_smtp_relay_port, "'")) ?>">
  106. </div>
  107. <div class="u-mb10">
  108. <label for="v_smtp_relay_user" class="form-label"><?= _("Username") ?></label>
  109. <input type="text" class="form-control" name="v_smtp_relay_user" id="v_smtp_relay_user" value="<?= htmlentities(trim($v_smtp_relay_user, "'")) ?>">
  110. </div>
  111. <div class="u-mb10">
  112. <label for="v_smtp_relay_pass" class="form-label"><?= _("Password") ?></label>
  113. <input type="text" class="form-control" name="v_smtp_relay_pass" id="v_smtp_relay_pass">
  114. </div>
  115. </div>
  116. <?php } ?>
  117. </div>
  118. </form>
  119. </div>