add_mail_acc.php 5.7 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/?<?= tohtml(http_build_query(["domain" => trim($v_domain, "'"), "token" => $_SESSION["token"]])) ?>">
  6. <i class="fas fa-arrow-left icon-blue"></i><?= tohtml( _("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><?= tohtml( _("Save")) ?>
  12. </button>
  13. </div>
  14. </div>
  15. </div>
  16. <!-- End toolbar -->
  17. <div class="container">
  18. <form
  19. x-data="{
  20. showAdvanced: <?= tohtml(empty($v_adv) ? "false" : "true") ?>
  21. }"
  22. id="main-form"
  23. name="v_add_mail_acc"
  24. method="post"
  25. >
  26. <input type="hidden" name="token" value="<?= tohtml($_SESSION["token"]) ?>">
  27. <input type="hidden" name="ok_acc" value="add">
  28. <div class="form-container form-container-wide">
  29. <h1 class="u-mb20"><?= tohtml( _("Add Mail Account")) ?></h1>
  30. <?php show_alert_message($_SESSION); ?>
  31. <div class="sidebar-right-grid">
  32. <div class="sidebar-right-grid-content">
  33. <div class="u-mb10">
  34. <label for="v_domain" class="form-label"><?= tohtml( _("Domain")) ?></label>
  35. <input type="text" class="form-control" name="v_domain" id="v_domain" value="<?= tohtml(trim($v_domain, "'")) ?>" disabled>
  36. <input type="hidden" name="v_domain" value="<?= tohtml(trim($v_domain, "'")) ?>">
  37. </div>
  38. <div class="u-mb10">
  39. <label for="v_account" class="form-label"><?= tohtml( _("Account")) ?></label>
  40. <input type="text" class="form-control js-account-input" name="v_account" id="v_account" value="<?= tohtml(trim($v_account, "'")) ?>" required>
  41. </div>
  42. <div class="u-mb10">
  43. <label for="v_password" class="form-label">
  44. <?= tohtml( _("Password")) ?>
  45. <button type="button" title="<?= tohtml( _("Generate")) ?>" class="u-unstyled-button u-ml5 js-generate-password">
  46. <i class="fas fa-arrows-rotate icon-green"></i>
  47. </button>
  48. </label>
  49. <div class="u-pos-relative u-mb10">
  50. <input type="text" class="form-control js-password-input" name="v_password" id="v_password" required>
  51. <div class="password-meter">
  52. <meter max="4" class="password-meter-input js-password-meter"></meter>
  53. </div>
  54. </div>
  55. </div>
  56. <p class="u-mb10"><?= tohtml( _("Your password must have at least")) ?>:</p>
  57. <ul class="u-list-bulleted u-mb20">
  58. <li><?= tohtml( _("8 characters long")) ?></li>
  59. <li><?= tohtml( _("1 uppercase & 1 lowercase character")) ?></li>
  60. <li><?= tohtml( _("1 number")) ?></li>
  61. </ul>
  62. <button x-on:click="showAdvanced = !showAdvanced" type="button" class="button button-secondary u-mb20">
  63. <?= tohtml( _("Advanced Options")) ?>
  64. </button>
  65. <div x-cloak x-show="showAdvanced" id="advtable">
  66. <div class="u-mb10">
  67. <label for="v_quota" class="form-label">
  68. <?= tohtml( _("Quota")) ?> <span class="optional">(<?= tohtml( _("in MB")) ?>)</span>
  69. </label>
  70. <div class="u-pos-relative">
  71. <input type="text" class="form-control" name="v_quota" id="v_quota" value="<?= tohtml(trim($v_quota, "'")) ?>">
  72. <button type="button" class="unlimited-toggle js-unlimited-toggle" title="<?= tohtml( _("Unlimited")) ?>">
  73. <i class="fas fa-infinity"></i>
  74. </button>
  75. </div>
  76. </div>
  77. <div class="u-mb10">
  78. <label for="v_aliases" class="form-label">
  79. <?= tohtml( _("Aliases")) ?> <span class="optional">(<?= tohtml( _("Use local-part without domain name")) ?>)</span>
  80. </label>
  81. <textarea class="form-control" name="v_aliases" id="v_aliases"><?= tohtml(trim($v_aliases, "'")) ?></textarea>
  82. </div>
  83. <div class="u-mb10">
  84. <label for="v_fwd" class="form-label">
  85. <?= tohtml( _("Forward to")) ?> <span class="optional">(<?= tohtml( _("One or more email addresses")) ?>)</span>
  86. </label>
  87. <textarea class="form-control js-forward-to-textarea" name="v_fwd" id="v_fwd" <?php if ($v_blackhole == 'yes') echo "disabled"; ?>><?= tohtml(trim($v_fwd, "'")) ?></textarea>
  88. </div>
  89. <div class="form-check">
  90. <input class="form-check-input js-discard-all-mail" type="checkbox" name="v_blackhole" id="v_blackhole" <?php if ($v_blackhole == 'yes') echo 'checked' ?>>
  91. <label for="v_blackhole">
  92. <?= tohtml( _("Discard all mail")) ?>
  93. </label>
  94. </div>
  95. <div class="form-check <?php if ($v_blackhole == 'yes') { echo 'u-hidden'; } ?>">
  96. <input class="form-check-input js-do-not-store-checkbox" type="checkbox" name="v_fwd_only" id="v_fwd_for" <?php if ($v_fwd_only == 'yes') echo 'checked' ?>>
  97. <label for="v_fwd_for">
  98. <?= tohtml( _("Do not store forwarded mail")) ?>
  99. </label>
  100. </div>
  101. <div class="u-mt10 u-mb10">
  102. <label for="v_rate" class="form-label">
  103. <?= tohtml( _("Rate Limit")) ?> <span class="optional">(<?= tohtml( _("email / hour")) ?>)</span>
  104. </label>
  105. <input type="text" class="form-control" name="v_rate" id="v_rate" value="<?= tohtml(trim($v_rate, "'")) ?>" <?php if ($_SESSION['userContext'] != "admin"){ echo "disabled"; }?>>
  106. </div>
  107. </div>
  108. <div class="u-mt15 u-mb20">
  109. <label for="v_send_email" class="form-label">
  110. <?= tohtml( _("Email login credentials to:")) ?>
  111. </label>
  112. <input type="email" class="form-control" name="v_send_email" id="v_send_email" value="<?= tohtml(trim($v_send_email, "'")) ?>">
  113. </div>
  114. </div>
  115. <div class="sidebar-right-grid-sidebar">
  116. <?php require $_SERVER["HESTIA"] . "/web/templates/includes/email-settings-panel.php"; ?>
  117. </div>
  118. </div>
  119. </div>
  120. </form>
  121. </div>