blob: f606bd452bc58d7e40060a3f639b0dbcc561acbd [file] [log] [blame]
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01001{% extends 'edit.twig' %}
2
3{% block inner_content %}
4{% if result %}
5<hr>
6<div id="medit" class="tab-pane fade show active" role="tabpanel" aria-labelledby="mailbox-edit">
7 <form class="form-horizontal" data-id="editmailbox_template" role="form" method="post">
8
9 <input type="hidden" value="default" name="sender_acl">
10 <input type="hidden" value="0" name="force_pw_update">
11 <input type="hidden" value="0" name="sogo_access">
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010012 <input type="hidden" value="0" name="protocol_access">
13
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010014 <div class="row mb-4">
15 <label class="control-label col-sm-2" for="template">{{ lang.mailbox.template }}</label>
16 <div class="col-sm-10">
17 <div class="input-group mb-3">
18 <input type="text" name="template" class="form-control" aria-label="Text input with dropdown button" value="{{ template.template }}" />
19 </div>
20 </div>
21 </div>
22 <div class="row mb-2">
23 <label class="control-label col-sm-2">{{ lang.add.tags }}</label>
24 <div class="col-sm-10">
25 <div class="form-control tag-box">
26 <input id="tags" type="text" class="tag-input">
27 <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span>
28 <input type="hidden" value='{{ template.attributes.tags|json_encode }}' name="tags" class="tag-values" />
29 </div>
30 </div>
31 </div>
32 <div class="row mb-2">
33 <label class="control-label col-sm-2" for="quota">{{ lang.edit.quota_mb }}</label>
34 <div class="col-sm-10">
35 <input type="number" name="quota" class="w-100 form-control" min="0" value="{{ template.attributes.quota / 1048576 }}">
36 <small class="text-muted">0 = ∞</small>
37 </div>
38 </div>
39 <div class="row mb-2">
40 <label class="control-label col-sm-2">{{ lang.user.quarantine_notification }}</label>
41 <div class="col-sm-10">
42 <div class="btn-group">
43 <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 %}>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010044 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_never">{{ lang.user.never }}</label>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010045
46 <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 %}>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010047 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_hourly">{{ lang.user.hourly }}</label>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010048
49 <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 %}>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010050 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_daily">{{ lang.user.daily }}</label>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010051
52 <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 %}>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010053 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_weekly">{{ lang.user.weekly }}</label>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010054 </div>
55 <p class="text-muted"><small>{{ lang.user.quarantine_notification_info }}</small></p>
56 </div>
57 </div>
58 <div class="row mb-2">
59 <label class="control-label col-sm-2">{{ lang.user.quarantine_category }}</label>
60 <div class="col-sm-10">
61 <div class="btn-group">
62 <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 %}>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010063 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_category_reject">{{ lang.user.q_reject }}</label>
64
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010065 <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 %}>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010066 <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>
67
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010068 <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 %}>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010069 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_category_all">{{ lang.user.q_all }}</label>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010070 </div>
71 <p class="text-muted"><small>{{ lang.user.quarantine_category_info }}</small></p>
72 </div>
73 </div>
74 <div class="row mb-4">
75 <label class="control-label col-sm-2" for="sender_acl">{{ lang.user.tls_policy }}</label>
76 <div class="col-sm-10">
77 <div class="btn-group">
78 <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 %}>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010079 <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>
80
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010081 <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 %}>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010082 <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>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010083 </div>
84 </div>
85 </div>
86 <div class="row mb-2">
87 <label class="control-label col-sm-2" for="protocol_access">{{ lang.edit.allowed_protocols }}</label>
88 <div class="col-sm-10">
89 <select name="protocol_access" multiple class="form-control">
90 <option value="imap"{% if template.attributes.imap_access == '1' %} selected{% endif %}>IMAP</option>
91 <option value="pop3"{% if template.attributes.pop3_access == '1' %} selected{% endif %}>POP3</option>
92 <option value="smtp"{% if template.attributes.smtp_access == '1' %} selected{% endif %}>SMTP</option>
93 <option value="sieve"{% if template.attributes.sieve_access == '1' %} selected{% endif %}>Sieve</option>
94 </select>
95 </div>
96 </div>
97 <div class="row mb-4">
98 <label class="control-label col-sm-2">ACL</label>
99 <div class="col-sm-10">
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +0100100 <select id="template_user_acl" name="acl" size="10" multiple class="form-control">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100101 <option value="spam_alias" {% if template.attributes.acl_spam_alias == '1' %} selected{% endif %}>{{ lang.acl["spam_alias"] }}</option>
102 <option value="tls_policy" {% if template.attributes.acl_tls_policy == '1' %} selected{% endif %}>{{ lang.acl["tls_policy"] }}</option>
103 <option value="spam_score" {% if template.attributes.acl_spam_score == '1' %} selected{% endif %}>{{ lang.acl["spam_score"] }}</option>
104 <option value="spam_policy" {% if template.attributes.acl_spam_policy == '1' %} selected{% endif %}>{{ lang.acl["spam_policy"] }}</option>
105 <option value="delimiter_action" {% if template.attributes.acl_delimiter_action == '1' %} selected{% endif %}>{{ lang.acl["delimiter_action"] }}</option>
106 <option value="syncjobs" {% if template.attributes.acl_syncjobs == '1' %} selected{% endif %}>{{ lang.acl["syncjobs"] }}</option>
107 <option value="eas_reset" {% if template.attributes.acl_eas_reset == '1' %} selected{% endif %}>{{ lang.acl["eas_reset"] }}</option>
108 <option value="sogo_profile_reset" {% if template.attributes.acl_sogo_profile_reset == '1' %} selected{% endif %}>{{ lang.acl["sogo_profile_reset"] }}</option>
109 <option value="pushover" {% if template.attributes.acl_pushover == '1' %} selected{% endif %}>{{ lang.acl["pushover"] }}</option>
110 <option value="quarantine" {% if template.attributes.acl_quarantine == '1' %} selected{% endif %}>{{ lang.acl["quarantine"] }}</option>
111 <option value="quarantine_attachments" {% if template.attributes.acl_quarantine_attachments == '1' %} selected{% endif %}>{{ lang.acl["quarantine_attachments"] }}</option>
112 <option value="quarantine_notification" {% if template.attributes.acl_quarantine_notification == '1' %} selected{% endif %}>{{ lang.acl["quarantine_notification"] }}</option>
113 <option value="quarantine_category" {% if template.attributes.acl_quarantine_category == '1' %} selected{% endif %}>{{ lang.acl["quarantine_category"] }}</option>
114 <option value="app_passwds" {% if template.attributes.acl_app_passwds == '1' %} selected{% endif %}>{{ lang.acl["app_passwds"] }}</option>
115 </select>
116 </div>
117 </div>
118 <div class="row mb-4">
119 <label class="control-label col-sm-2">{{ lang.acl.ratelimit }}</label>
120 <div class="col-sm-10">
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +0100121 <div class="input-group">
122 <input name="rl_value" type="number" autocomplete="off" value="{{ template.attributes.rl_value }}" class="form-control mb-2" placeholder="{{ lang.ratelimit.disabled }}">
123 <select name="rl_frame" class="form-control">
124 {% include 'mailbox/rl-frame.twig' %}
125 </select>
126 </div>
127 <p class="text-muted mt-1">{{ lang.edit.mbox_rl_info }}</p>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100128 </div>
129 </div>
130 <hr>
131 <div class="row my-2">
132 <div class="offset-sm-2 col-sm-10">
133 <select name="active" class="form-control">
134 <option value="1"{% if template.attributes.active == '1' %} selected{% endif %}>{{ lang.edit.active }}</option>
135 <option value="2"{% if template.attributes.active == '2' %} selected{% endif %}>{{ lang.edit.disable_login }}</option>
136 <option value="0"{% if template.attributes.active == '0' %} selected{% endif %}>{{ lang.edit.inactive }}</option>
137 </select>
138 </div>
139 </div>
140 <div class="row">
141 <div class="offset-sm-2 col-sm-10">
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +0100142 <div class="form-check">
143 <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>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100144 <small class="text-muted">{{ lang.edit.force_pw_update_info|format(ui_texts.main_name) }}</small>
145 </div>
146 </div>
147 </div>
148 {% if not skip_sogo %}
149 <div class="row">
150 <div class="offset-sm-2 col-sm-10">
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +0100151 <div class="form-check">
152 <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>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100153 <small class="text-muted">{{ lang.edit.sogo_access_info }}</small>
154 </div>
155 </div>
156 </div>
157 {% endif %}
158 <div class="row my-2">
159 <div class="offset-sm-2 col-sm-10">
160 <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>
161 </div>
162 </div>
163 </form>
164</div>
165{% else %}
166 {{ parent() }}
167{% endif %}
168{% endblock %}