add_mail.php 5.4 KB

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