mailbox-templates.twig 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. {% extends 'edit.twig' %}
  2. {% block inner_content %}
  3. {% if result %}
  4. <hr>
  5. <div id="medit" class="tab-pane fade show active" role="tabpanel" aria-labelledby="mailbox-edit">
  6. <form class="form-horizontal" data-id="editmailbox_template" role="form" method="post">
  7. <input type="hidden" value="default" name="sender_acl">
  8. <input type="hidden" value="0" name="force_pw_update">
  9. <input type="hidden" value="0" name="sogo_access">
  10. <input type="hidden" value="0" name="protocol_access">
  11. <div class="row mb-4">
  12. <label class="control-label col-sm-2" for="template">{{ lang.mailbox.template }}</label>
  13. <div class="col-sm-10">
  14. <div class="input-group mb-3">
  15. <input type="text" name="template" class="form-control" aria-label="Text input with dropdown button" value="{{ template.template }}" />
  16. </div>
  17. </div>
  18. </div>
  19. <div class="row mb-2">
  20. <label class="control-label col-sm-2">{{ lang.add.tags }}</label>
  21. <div class="col-sm-10">
  22. <div class="form-control tag-box">
  23. <input id="tags" type="text" class="tag-input">
  24. <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span>
  25. <input type="hidden" value='{{ template.attributes.tags|json_encode }}' name="tags" class="tag-values" />
  26. </div>
  27. </div>
  28. </div>
  29. <div class="row mb-2">
  30. <label class="control-label col-sm-2" for="quota">{{ lang.edit.quota_mb }}</label>
  31. <div class="col-sm-10">
  32. <input type="number" name="quota" class="w-100 form-control" min="0" value="{{ template.attributes.quota / 1048576 }}">
  33. <small class="text-muted">0 = ∞</small>
  34. </div>
  35. </div>
  36. <div class="row mb-2">
  37. <label class="control-label col-sm-2">{{ lang.user.quarantine_notification }}</label>
  38. <div class="col-sm-10">
  39. <div class="btn-group">
  40. <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_never" autocomplete="off" value="never" {% if template.attributes.quarantine_notification == 'never' %}checked{% endif %}>
  41. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_never">{{ lang.user.never }}</label>
  42. <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_hourly" autocomplete="off" value="hourly" {% if template.attributes.quarantine_notification == 'hourly' %}checked{% endif %}>
  43. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_hourly">{{ lang.user.hourly }}</label>
  44. <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_daily" autocomplete="off" value="daily" {% if template.attributes.quarantine_notification == 'daily' %}checked{% endif %}>
  45. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_daily">{{ lang.user.daily }}</label>
  46. <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_weekly" autocomplete="off" value="weekly" {% if template.attributes.quarantine_notification == 'weekly' %}checked{% endif %}>
  47. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_weekly">{{ lang.user.weekly }}</label>
  48. </div>
  49. <p class="text-muted"><small>{{ lang.user.quarantine_notification_info }}</small></p>
  50. </div>
  51. </div>
  52. <div class="row mb-2">
  53. <label class="control-label col-sm-2">{{ lang.user.quarantine_category }}</label>
  54. <div class="col-sm-10">
  55. <div class="btn-group">
  56. <input type="radio" class="btn-check" name="quarantine_category" id="quarantine_category_reject" autocomplete="off" value="reject" {% if template.attributes.quarantine_category == 'reject' %}checked{% endif %}>
  57. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_category_reject">{{ lang.user.q_reject }}</label>
  58. <input type="radio" class="btn-check" name="quarantine_category" id="quarantine_category_add_header" autocomplete="off" value="add_header" {% if template.attributes.quarantine_category == 'add_header' %}checked{% endif %}>
  59. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_category_add_header">{{ lang.user.q_add_header }}</label>
  60. <input type="radio" class="btn-check" name="quarantine_category" id="quarantine_category_all" autocomplete="off" value="all" {% if template.attributes.quarantine_category == 'all' %}checked{% endif %}>
  61. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_category_all">{{ lang.user.q_all }}</label>
  62. </div>
  63. <p class="text-muted"><small>{{ lang.user.quarantine_category_info }}</small></p>
  64. </div>
  65. </div>
  66. <div class="row mb-4">
  67. <label class="control-label col-sm-2" for="sender_acl">{{ lang.user.tls_policy }}</label>
  68. <div class="col-sm-10">
  69. <div class="btn-group">
  70. <input type="checkbox" class="btn-check" name="tls_enforce_in" id="tls_enforce_in" autocomplete="off" value="1" {% if template.attributes.tls_enforce_in == '1' %}checked{% endif %}>
  71. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="tls_enforce_in">{{ lang.user.tls_enforce_in }}</label>
  72. <input type="checkbox" class="btn-check" name="tls_enforce_out" id="tls_enforce_out" autocomplete="off" value="1" {% if template.attributes.tls_enforce_out == '1' %}checked{% endif %}>
  73. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="tls_enforce_out">{{ lang.user.tls_enforce_out }}</label>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="row mb-2">
  78. <label class="control-label col-sm-2" for="protocol_access">{{ lang.edit.allowed_protocols }}</label>
  79. <div class="col-sm-10">
  80. <select name="protocol_access" multiple class="form-control">
  81. <option value="imap"{% if template.attributes.imap_access == '1' %} selected{% endif %}>IMAP</option>
  82. <option value="pop3"{% if template.attributes.pop3_access == '1' %} selected{% endif %}>POP3</option>
  83. <option value="smtp"{% if template.attributes.smtp_access == '1' %} selected{% endif %}>SMTP</option>
  84. <option value="sieve"{% if template.attributes.sieve_access == '1' %} selected{% endif %}>Sieve</option>
  85. </select>
  86. </div>
  87. </div>
  88. <div class="row mb-4">
  89. <label class="control-label col-sm-2">ACL</label>
  90. <div class="col-sm-10">
  91. <select id="template_user_acl" name="acl" size="10" multiple class="form-control">
  92. <option value="spam_alias" {% if template.attributes.acl_spam_alias == '1' %} selected{% endif %}>{{ lang.acl["spam_alias"] }}</option>
  93. <option value="tls_policy" {% if template.attributes.acl_tls_policy == '1' %} selected{% endif %}>{{ lang.acl["tls_policy"] }}</option>
  94. <option value="spam_score" {% if template.attributes.acl_spam_score == '1' %} selected{% endif %}>{{ lang.acl["spam_score"] }}</option>
  95. <option value="spam_policy" {% if template.attributes.acl_spam_policy == '1' %} selected{% endif %}>{{ lang.acl["spam_policy"] }}</option>
  96. <option value="delimiter_action" {% if template.attributes.acl_delimiter_action == '1' %} selected{% endif %}>{{ lang.acl["delimiter_action"] }}</option>
  97. <option value="syncjobs" {% if template.attributes.acl_syncjobs == '1' %} selected{% endif %}>{{ lang.acl["syncjobs"] }}</option>
  98. <option value="eas_reset" {% if template.attributes.acl_eas_reset == '1' %} selected{% endif %}>{{ lang.acl["eas_reset"] }}</option>
  99. <option value="sogo_profile_reset" {% if template.attributes.acl_sogo_profile_reset == '1' %} selected{% endif %}>{{ lang.acl["sogo_profile_reset"] }}</option>
  100. <option value="pushover" {% if template.attributes.acl_pushover == '1' %} selected{% endif %}>{{ lang.acl["pushover"] }}</option>
  101. <option value="quarantine" {% if template.attributes.acl_quarantine == '1' %} selected{% endif %}>{{ lang.acl["quarantine"] }}</option>
  102. <option value="quarantine_attachments" {% if template.attributes.acl_quarantine_attachments == '1' %} selected{% endif %}>{{ lang.acl["quarantine_attachments"] }}</option>
  103. <option value="quarantine_notification" {% if template.attributes.acl_quarantine_notification == '1' %} selected{% endif %}>{{ lang.acl["quarantine_notification"] }}</option>
  104. <option value="quarantine_category" {% if template.attributes.acl_quarantine_category == '1' %} selected{% endif %}>{{ lang.acl["quarantine_category"] }}</option>
  105. <option value="app_passwds" {% if template.attributes.acl_app_passwds == '1' %} selected{% endif %}>{{ lang.acl["app_passwds"] }}</option>
  106. </select>
  107. </div>
  108. </div>
  109. <div class="row mb-4">
  110. <label class="control-label col-sm-2">{{ lang.acl.ratelimit }}</label>
  111. <div class="col-sm-10">
  112. <div class="input-group">
  113. <input name="rl_value" type="number" autocomplete="off" value="{{ template.attributes.rl_value }}" class="form-control mb-2" placeholder="{{ lang.ratelimit.disabled }}">
  114. <select name="rl_frame" class="form-control">
  115. {% include 'mailbox/rl-frame.twig' %}
  116. </select>
  117. </div>
  118. <p class="text-muted mt-1">{{ lang.edit.mbox_rl_info }}</p>
  119. </div>
  120. </div>
  121. <hr>
  122. <div class="row my-2">
  123. <div class="offset-sm-2 col-sm-10">
  124. <select name="active" class="form-control">
  125. <option value="1"{% if template.attributes.active == '1' %} selected{% endif %}>{{ lang.edit.active }}</option>
  126. <option value="2"{% if template.attributes.active == '2' %} selected{% endif %}>{{ lang.edit.disable_login }}</option>
  127. <option value="0"{% if template.attributes.active == '0' %} selected{% endif %}>{{ lang.edit.inactive }}</option>
  128. </select>
  129. </div>
  130. </div>
  131. <div class="row">
  132. <div class="offset-sm-2 col-sm-10">
  133. <div class="form-check">
  134. <label><input type="checkbox" class="form-check-input" value="1" name="force_pw_update"{% if template.attributes.force_pw_update == '1' %} checked{% endif %}> {{ lang.edit.force_pw_update }}</label>
  135. <small class="text-muted">{{ lang.edit.force_pw_update_info|format(ui_texts.main_name) }}</small>
  136. </div>
  137. </div>
  138. </div>
  139. {% if not skip_sogo %}
  140. <div class="row">
  141. <div class="offset-sm-2 col-sm-10">
  142. <div class="form-check">
  143. <label><input type="checkbox" class="form-check-input" value="1" name="sogo_access"{% if template.attributes.sogo_access == '1' %} checked{% endif %}> {{ lang.edit.sogo_access }}</label>
  144. <small class="text-muted">{{ lang.edit.sogo_access_info }}</small>
  145. </div>
  146. </div>
  147. </div>
  148. {% endif %}
  149. <div class="row my-2">
  150. <div class="offset-sm-2 col-sm-10">
  151. <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="editmailbox_template" data-item="{{ template.id }}" data-api-url='edit/mailbox/template' data-api-attr='{}' href="#">{{ lang.edit.save }}</button>
  152. </div>
  153. </div>
  154. </form>
  155. </div>
  156. {% else %}
  157. {{ parent() }}
  158. {% endif %}
  159. {% endblock %}