blob: fea99bdd2433f362e881c99494225cb8d77023a1 [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">
12 <input type="hidden" value="0" name="protocol_access">
13
14 <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 %}>
44 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_notification_never">{{ lang.user.never }}</label>
45
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 %}>
47 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_notification_hourly">{{ lang.user.hourly }}</label>
48
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 %}>
50 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_notification_daily">{{ lang.user.daily }}</label>
51
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 %}>
53 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_notification_weekly">{{ lang.user.weekly }}</label>
54 </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 %}>
63 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_category_reject">{{ lang.user.q_reject }}</label>
64
65 <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 %}>
66 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_category_add_header">{{ lang.user.q_add_header }}</label>
67
68 <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 %}>
69 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_category_all">{{ lang.user.q_all }}</label>
70 </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 %}>
79 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="tls_enforce_in">{{ lang.user.tls_enforce_in }}</label>
80
81 <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 %}>
82 <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="tls_enforce_out">{{ lang.user.tls_enforce_out }}</label>
83 </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">
100 <select id="template_user_acl" name="acl" size="10" multiple class="form-control">
101 <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">
121 <input name="rl_value" type="number" autocomplete="off" value="{{ template.attributes.rl_value }}" class="form-control mb-2" placeholder="{{ lang.ratelimit.disabled }}">
122 <select name="rl_frame" class="form-control">
123 <option value="s"{% if template.attributes.rl_frame == 's' %} selected{% endif %}>{{ lang.ratelimit.second }}</option>
124 <option value="m"{% if template.attributes.rl_frame == 'm' %} selected{% endif %}>{{ lang.ratelimit.minute }}</option>
125 <option value="h"{% if template.attributes.rl_frame == 'h' %} selected{% endif %}>{{ lang.ratelimit.hour }}</option>
126 <option value="d"{% if template.attributes.rl_frame == 'd' %} selected{% endif %}>{{ lang.ratelimit.day }}</option>
127 </select>
128 <p class="text-muted mt-3">{{ lang.edit.mbox_rl_info }}</p>
129 </div>
130 </div>
131 <hr>
132 <div class="row my-2">
133 <div class="offset-sm-2 col-sm-10">
134 <select name="active" class="form-control">
135 <option value="1"{% if template.attributes.active == '1' %} selected{% endif %}>{{ lang.edit.active }}</option>
136 <option value="2"{% if template.attributes.active == '2' %} selected{% endif %}>{{ lang.edit.disable_login }}</option>
137 <option value="0"{% if template.attributes.active == '0' %} selected{% endif %}>{{ lang.edit.inactive }}</option>
138 </select>
139 </div>
140 </div>
141 <div class="row">
142 <div class="offset-sm-2 col-sm-10">
143 <div class="checkbox">
144 <label><input type="checkbox" value="1" name="force_pw_update"{% if template.attributes.force_pw_update == '1' %} checked{% endif %}> {{ lang.edit.force_pw_update }}</label>
145 <small class="text-muted">{{ lang.edit.force_pw_update_info|format(ui_texts.main_name) }}</small>
146 </div>
147 </div>
148 </div>
149 {% if not skip_sogo %}
150 <div class="row">
151 <div class="offset-sm-2 col-sm-10">
152 <div class="checkbox">
153 <label><input type="checkbox" value="1" name="sogo_access"{% if template.attributes.sogo_access == '1' %} checked{% endif %}> {{ lang.edit.sogo_access }}</label>
154 <small class="text-muted">{{ lang.edit.sogo_access_info }}</small>
155 </div>
156 </div>
157 </div>
158 {% endif %}
159 <div class="row my-2">
160 <div class="offset-sm-2 col-sm-10">
161 <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>
162 </div>
163 </div>
164 </form>
165</div>
166{% else %}
167 {{ parent() }}
168{% endif %}
169{% endblock %}