blob: 77533ea7b6562190479a90615c61fcd4cb4381cf [file] [log] [blame]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01001<?php
2if (!isset($_SESSION['mailcow_cc_role'])) {
3 header('Location: /');
4 exit();
5}
6?>
7<!-- add mailbox modal -->
8<div class="modal fade" id="addMailboxModal" tabindex="-1" role="dialog" aria-hidden="true">
9 <div class="modal-dialog modal-lg">
10 <div class="modal-content">
11 <div class="modal-header">
12 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
13 <h3 class="modal-title"><?=$lang['mailbox']['add_mailbox'];?></h3>
14 </div>
15 <div class="modal-body">
16 <form class="form-horizontal" data-cached-form="true" data-id="add_mailbox" role="form" autocomplete="off">
17 <div class="form-group">
18 <label class="control-label col-sm-2" for="local_part"><?=$lang['add']['mailbox_username'];?></label>
19 <div class="col-sm-10">
20 <input type="text" pattern="[A-Za-z0-9\.!#$%&'*+/=?^_`{|}~-]+" autocorrect="off" autocapitalize="none" class="form-control" name="local_part" required>
21 </div>
22 </div>
23 <div class="form-group">
24 <label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?></label>
25 <div class="col-sm-10">
26 <select class="full-width-select" data-live-search="true" id="addSelectDomain" name="domain" required>
27 <?php
28 foreach (mailbox('get', 'domains') as $domain) {
29 echo "<option>".htmlspecialchars($domain)."</option>";
30 }
31 ?>
32 </select>
33 </div>
34 </div>
35 <div class="form-group">
36 <label class="control-label col-sm-2" for="name"><?=$lang['add']['full_name'];?></label>
37 <div class="col-sm-10">
38 <input type="text" class="form-control" name="name">
39 </div>
40 </div>
41 <div class="form-group">
42 <label class="control-label col-sm-2" for="addInputQuota"><?=$lang['add']['quota_mb'];?>
43 <br /><span id="quotaBadge" class="badge">max. - MiB</span>
44 </label>
45 <div class="col-sm-10">
46 <input type="text" class="form-control" name="quota" min="0" max="" id="addInputQuota" disabled value="<?=$lang['add']['select_domain'];?>" required>
47 <small class="help-block">0 = ∞</small>
48 <div class="label label-warning addInputQuotaExhausted" style="display:none;"><?=$lang['warning']['quota_exceeded_scope'];?></div>
49 </div>
50 </div>
51 <div class="form-group">
52 <label class="control-label col-sm-2" for="password"><?=$lang['add']['password'];?> (<a href="#" class="generate_password"><?=$lang['add']['generate'];?></a>)</label>
53 <div class="col-sm-10">
54 <input type="password" data-pwgen-field="true" data-hibp="true" class="form-control" name="password" placeholder="" autocomplete="new-password" required>
55 </div>
56 </div>
57 <div class="form-group">
58 <label class="control-label col-sm-2" for="password2"><?=$lang['add']['password_repeat'];?></label>
59 <div class="col-sm-10">
60 <input type="password" data-pwgen-field="true" class="form-control" name="password2" placeholder="" autocomplete="new-password" required>
61 </div>
62 </div>
63 <div class="form-group">
64 <div class="col-sm-offset-2 col-sm-10">
65 <select name="active" class="form-control">
66 <option value="1" selected><?=$lang['add']['active'];?></option>
67 <option value="2"><?=$lang['add']['disable_login'];?></option>
68 <option value="0"><?=$lang['add']['inactive'];?></option>
69 </select>
70 </div>
71 </div>
72 <hr>
73 <div class="form-group">
74 <div class="col-sm-offset-2 col-sm-10">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020075 <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_mailbox" data-api-url='add/mailbox' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010076 </div>
77 </div>
78 </form>
79 </div>
80 </div>
81 </div>
82</div><!-- add mailbox modal -->
83<!-- add domain modal -->
84<div class="modal fade" id="addDomainModal" tabindex="-1" role="dialog" aria-hidden="true">
85 <div class="modal-dialog modal-lg">
86 <div class="modal-content">
87 <div class="modal-header">
88 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
89 <h3 class="modal-title"><?=$lang['mailbox']['add_domain'];?></h3>
90 </div>
91 <div class="modal-body">
92 <form class="form-horizontal" data-cached-form="true" data-id="add_domain" role="form">
93 <div class="form-group">
94 <label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?></label>
95 <div class="col-sm-10">
96 <input type="text" autocorrect="off" autocapitalize="none" class="form-control" name="domain" required>
97 </div>
98 </div>
99 <div class="form-group">
100 <label class="control-label col-sm-2" for="description"><?=$lang['add']['description'];?></label>
101 <div class="col-sm-10">
102 <input type="text" class="form-control" name="description">
103 </div>
104 </div>
105 <div class="form-group">
106 <label class="control-label col-sm-2" for="aliases"><?=$lang['add']['max_aliases'];?></label>
107 <div class="col-sm-10">
108 <input type="number" class="form-control" name="aliases" value="400" required>
109 </div>
110 </div>
111 <div class="form-group">
112 <label class="control-label col-sm-2" for="mailboxes"><?=$lang['add']['max_mailboxes'];?></label>
113 <div class="col-sm-10">
114 <input type="number" class="form-control" name="mailboxes" value="10" required>
115 </div>
116 </div>
117 <div class="form-group">
118 <label class="control-label col-sm-2" for="defquota"><?=$lang['add']['mailbox_quota_def'];?></label>
119 <div class="col-sm-10">
120 <input type="number" class="form-control" name="defquota" value="3072" required>
121 </div>
122 </div>
123 <div class="form-group">
124 <label class="control-label col-sm-2" for="maxquota"><?=$lang['add']['mailbox_quota_m'];?></label>
125 <div class="col-sm-10">
126 <input type="number" class="form-control" name="maxquota" value="10240" required>
127 </div>
128 </div>
129 <div class="form-group">
130 <label class="control-label col-sm-2" for="quota"><?=$lang['add']['domain_quota_m'];?></label>
131 <div class="col-sm-10">
132 <input type="number" class="form-control" name="quota" value="10240" required>
133 </div>
134 </div>
135 <?php if (getenv('SKIP_SOGO') != "y") { ?>
136 <div class="form-group">
137 <div class="col-sm-offset-2 col-sm-10">
138 <div class="checkbox">
139 <label><input type="checkbox" value="1" name="gal" checked> <?=$lang['edit']['gal'];?></label>
140 <small class="help-block"><?=$lang['edit']['gal_info'];?></small>
141 </div>
142 </div>
143 </div>
144 <?php } ?>
145 <div class="form-group">
146 <div class="col-sm-offset-2 col-sm-10">
147 <div class="checkbox">
148 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
149 </div>
150 </div>
151 </div>
152 <hr>
153 <div class="form-group">
154 <label class="control-label col-sm-2" for="rl_frame"><?=$lang['acl']['ratelimit'];?></label>
155 <div class="col-sm-7">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200156 <input name="rl_value" type="number" value="<?=(!empty($rl['value'])) ? $rl['value'] : null;?>" class="form-control" placeholder="<?=$lang['ratelimit']['disabled']?>">
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100157 </div>
158 <div class="col-sm-3">
159 <select name="rl_frame" class="form-control">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200160 <option value="s" <?=(isset($rl['frame']) && $rl['frame'] == 's') ? 'selected' : null;?>><?=$lang['ratelimit']['second']?></option>
161 <option value="m" <?=(isset($rl['frame']) && $rl['frame'] == 'm') ? 'selected' : null;?>><?=$lang['ratelimit']['minute']?></option>
162 <option value="h" <?=(isset($rl['frame']) && $rl['frame'] == 'h') ? 'selected' : null;?>><?=$lang['ratelimit']['hour']?></option>
163 <option value="d" <?=(isset($rl['frame']) && $rl['frame'] == 'd') ? 'selected' : null;?>><?=$lang['ratelimit']['day']?></option>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100164 </select>
165 </div>
166 </div>
167 <hr>
168 <div class="form-group">
169 <label class="control-label col-sm-2"><?=$lang['add']['backup_mx_options'];?></label>
170 <div class="col-sm-10">
171 <div class="checkbox">
172 <label><input type="checkbox" value="1" name="backupmx"> <?=$lang['add']['relay_domain'];?></label>
173 <br>
174 <label><input type="checkbox" value="1" name="relay_all_recipients"> <?=$lang['add']['relay_all'];?></label>
175 <p><?=$lang['add']['relay_all_info'];?></p>
176 <label><input type="checkbox" value="1" name="relay_unknown_only" <?=(isset($result['relay_unknown_only']) && $result['relay_unknown_only']=="1") ? "checked" : null;?>> <?=$lang['add']['relay_unknown_only'];?></label>
177 <br>
178 <p><?=$lang['add']['relay_transport_info'];?></p>
179 <hr style="margin:25px 0px 0px 0px">
180 </div>
181 </div>
182 </div>
183 <hr>
184 <div class="form-group">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200185 <div class="col-sm-offset-2 col-sm-10 btn-group">
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100186 <?php if (getenv('SKIP_SOGO') != "y") { ?>
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200187 <button class="btn btn-xs-lg btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{}' href="#"><?=$lang['add']['add_domain_only'];?></button>
188 <button class="btn btn-xs-lg btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{"restart_sogo":"1"}' href="#"><?=$lang['add']['add_domain_restart'];?></button>
189 <div class="clearfix visible-xs"></div>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100190 <?php } else { ?>
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200191 <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{}' href="#"><?=$lang['add']['add'];?></button>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100192 <?php } ?>
193 </div>
194 </div>
195 <?php // TODO: Separate SOGo-related text
196 if (getenv('SKIP_SOGO') != "y") { ?>
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200197 <p><i class="bi bi-shield-fill-exclamation text-danger"></i> <?=$lang['add']['post_domain_add'];?></p>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100198 <?php } ?>
199 </form>
200 </div>
201 </div>
202 </div>
203</div><!-- add domain modal -->
204<!-- add resource modal -->
205<div class="modal fade" id="addResourceModal" tabindex="-1" role="dialog" aria-hidden="true">
206 <div class="modal-dialog modal-lg">
207 <div class="modal-content">
208 <div class="modal-header">
209 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
210 <h3 class="modal-title"><?=$lang['mailbox']['add_resource'];?></h3>
211 </div>
212 <div class="modal-body">
213 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_resource">
214 <div class="form-group">
215 <label class="control-label col-sm-2" for="description"><?=$lang['add']['description'];?></label>
216 <div class="col-sm-10">
217 <input type="text" class="form-control" name="description" required>
218 </div>
219 </div>
220 <div class="form-group">
221 <label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?></label>
222 <div class="col-sm-10">
223 <select data-live-search="true" name="domain" title="<?=$lang['add']['select'];?>" required>
224 <?php
225 foreach (mailbox('get', 'domains') as $domain) {
226 echo "<option>".htmlspecialchars($domain)."</option>";
227 }
228 ?>
229 </select>
230 </div>
231 </div>
232 <div class="form-group">
233 <label class="control-label col-sm-2" for="domain"><?=$lang['add']['kind'];?></label>
234 <div class="col-sm-10">
235 <select name="kind" title="<?=$lang['add']['select'];?>" required>
236 <option value="location">Location</option>
237 <option value="group">Group</option>
238 <option value="thing">Thing</option>
239 </select>
240 </div>
241 </div>
242 <div class="form-group">
243 <label class="control-label col-sm-2" for="multiple_bookings_select"><?=$lang['add']['multiple_bookings'];?></label>
244 <div class="col-sm-10">
245 <select name="multiple_bookings_select" id="multiple_bookings_select" title="<?=$lang['add']['select'];?>" required>
246 <option value="0"><?=$lang['mailbox']['booking_0'];?></option>
247 <option value="-1" selected><?=$lang['mailbox']['booking_lt0'];?></option>
248 <option value="custom"><?=$lang['mailbox']['booking_custom'];?></option>
249 </select>
250 <div style="display:none" id="multiple_bookings_custom_div">
251 <hr>
252 <input type="number" class="form-control" name="multiple_bookings_custom" id="multiple_bookings_custom">
253 </div>
254 <input type="hidden" name="multiple_bookings" id="multiple_bookings">
255 </div>
256 </div>
257 <div class="form-group">
258 <div class="col-sm-offset-2 col-sm-10">
259 <div class="checkbox">
260 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
261 </div>
262 </div>
263 </div>
264 <div class="form-group">
265 <div class="col-sm-offset-2 col-sm-10">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200266 <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_resource" data-api-url='add/resource' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100267 </div>
268 </div>
269 </form>
270 </div>
271 </div>
272 </div>
273</div><!-- add resource modal -->
274<!-- add alias modal -->
275<div class="modal fade" id="addAliasModal" tabindex="-1" role="dialog" aria-hidden="true">
276 <div class="modal-dialog modal-lg">
277 <div class="modal-content">
278 <div class="modal-header">
279 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
280 <h3 class="modal-title"><?=$lang['mailbox']['add_alias'];?></h3>
281 </div>
282 <div class="modal-body">
283 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_alias">
284 <input type="hidden" value="0" name="active">
285 <div class="form-group">
286 <label class="control-label col-sm-2" for="address"><?=$lang['add']['alias_address'];?></label>
287 <div class="col-sm-10">
288 <textarea autocorrect="off" autocapitalize="none" class="form-control" rows="5" name="address" id="address" required></textarea>
289 <p><?=$lang['add']['alias_address_info'];?></p>
290 </div>
291 </div>
292 <div class="form-group">
293 <label class="control-label col-sm-2" for="goto"><?=$lang['add']['target_address'];?></label>
294 <div class="col-sm-10">
295 <textarea id="textarea_alias_goto" autocorrect="off" autocapitalize="none" class="form-control" rows="5" id="goto" name="goto" required></textarea>
296 <p><?=$lang['add']['target_address_info'];?></p>
297 <div class="checkbox">
298 <label><input class="goto_checkbox" type="checkbox" value="1" name="goto_null"> <?=$lang['add']['goto_null'];?></label>
299 </div>
300 <div class="checkbox">
301 <label><input class="goto_checkbox" type="checkbox" value="1" name="goto_spam"> <?=$lang['add']['goto_spam'];?></label>
302 </div>
303 <div class="checkbox">
304 <label><input class="goto_checkbox" type="checkbox" value="1" name="goto_ham"> <?=$lang['add']['goto_ham'];?></label>
305 </div>
306 <?php if (getenv('SKIP_SOGO') != "y") { ?>
307 <hr>
308 <div class="checkbox">
309 <label><input type="checkbox" value="1" name="sogo_visible" checked> <?=$lang['edit']['sogo_visible'];?></label>
310 </div>
311 <p class="help-block"><?=$lang['edit']['sogo_visible_info'];?></p>
312 <?php } ?>
313 </div>
314 </div>
315 <div class="form-group">
316 <div class="col-sm-offset-2 col-sm-10">
317 <div class="checkbox">
318 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
319 </div>
320 </div>
321 </div>
322 <div class="form-group">
323 <div class="col-sm-offset-2 col-sm-10">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200324 <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_alias" data-api-url='add/alias' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100325 </div>
326 </div>
327 </form>
328 </div>
329 </div>
330 </div>
331</div><!-- add alias modal -->
332<!-- add domain alias modal -->
333<div class="modal fade" id="addAliasDomainModal" tabindex="-1" role="dialog" aria-hidden="true">
334 <div class="modal-dialog modal-lg">
335 <div class="modal-content">
336 <div class="modal-header">
337 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
338 <h3 class="modal-title"><?=$lang['mailbox']['add_domain_alias'];?></h3>
339 </div>
340 <div class="modal-body">
341 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_alias_domain">
342 <input type="hidden" value="0" name="active">
343 <div class="form-group">
344 <label class="control-label col-sm-2" for="alias_domain"><?=$lang['add']['alias_domain'];?></label>
345 <div class="col-sm-10">
346 <textarea autocorrect="off" autocapitalize="none" class="form-control" rows="5" name="alias_domain" id="alias_domain" required></textarea>
347 <p><?=$lang['add']['alias_domain_info'];?></p>
348 </div>
349 </div>
350 <div class="form-group">
351 <label class="control-label col-sm-2" for="target_domain"><?=$lang['add']['target_domain'];?></label>
352 <div class="col-sm-10">
353 <select data-live-search="true" name="target_domain" title="<?=$lang['add']['select'];?>" required>
354 <?php
355 foreach (mailbox('get', 'domains') as $domain) {
356 echo "<option>".htmlspecialchars($domain)."</option>";
357 }
358 ?>
359 </select>
360 </div>
361 </div>
362 <div class="form-group">
363 <div class="col-sm-offset-2 col-sm-10">
364 <div class="checkbox">
365 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
366 </div>
367 </div>
368 </div>
369 <hr>
370 <div class="form-group">
371 <label class="control-label col-sm-2" for="rl_frame"><?=$lang['acl']['ratelimit'];?></label>
372 <div class="col-sm-7">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200373 <input name="rl_value" type="number" value="<?=(!empty($rl['value'])) ? $rl['value'] : null;?>" class="form-control" placeholder="<?=$lang['ratelimit']['disabled']?>">
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100374 </div>
375 <div class="col-sm-3">
376 <select name="rl_frame" class="form-control">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200377 <option value="s" <?=(isset($rl['frame']) && $rl['frame'] == 's') ? 'selected' : null;?>><?=$lang['ratelimit']['second']?></option>
378 <option value="m" <?=(isset($rl['frame']) && $rl['frame'] == 'm') ? 'selected' : null;?>><?=$lang['ratelimit']['minute']?></option>
379 <option value="h" <?=(isset($rl['frame']) && $rl['frame'] == 'h') ? 'selected' : null;?>><?=$lang['ratelimit']['hour']?></option>
380 <option value="d" <?=(isset($rl['frame']) && $rl['frame'] == 'd') ? 'selected' : null;?>><?=$lang['ratelimit']['day']?></option>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100381 </select>
382 </div>
383 </div>
384 <div class="form-group">
385 <div class="col-sm-offset-2 col-sm-10">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200386 <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_alias_domain" data-api-url='add/alias-domain' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100387 </div>
388 </div>
389 </form>
390 </div>
391 </div>
392 </div>
393</div><!-- add domain alias modal -->
394<!-- add sync job modal -->
395<div class="modal fade" id="addSyncJobModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
396 <div class="modal-dialog modal-lg">
397 <div class="modal-content">
398 <div class="modal-header">
399 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
400 <h3 class="modal-title"><?=$lang['add']['syncjob'];?></h3>
401 </div>
402 <div class="modal-body">
403 <p class="help-block"><?=$lang['add']['syncjob_hint'];?></p>
404 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_syncjob">
405 <div class="form-group">
406 <label class="control-label col-sm-2" for="username"><?=$lang['add']['username'];?></label>
407 <div class="col-sm-10">
408 <select data-live-search="true" name="username" required>
409 <?php
410 $domains = mailbox('get', 'domains');
411 if (!empty($domains)) {
412 foreach ($domains as $domain) {
413 $mailboxes = mailbox('get', 'mailboxes', $domain);
414 foreach ($mailboxes as $mailbox) {
415 echo "<option>".htmlspecialchars($mailbox)."</option>";
416 }
417 }
418 }
419 ?>
420 </select>
421 </div>
422 </div>
423 <div class="form-group">
424 <label class="control-label col-sm-2" for="host1"><?=$lang['add']['hostname'];?></label>
425 <div class="col-sm-10">
426 <input type="text" class="form-control" name="host1" required>
427 </div>
428 </div>
429 <div class="form-group">
430 <label class="control-label col-sm-2" for="port1"><?=$lang['add']['port'];?></label>
431 <div class="col-sm-10">
432 <input type="number" class="form-control" name="port1" min="1" max="65535" value="143" required>
433 <small class="help-block">1-65535</small>
434 </div>
435 </div>
436 <div class="form-group">
437 <label class="control-label col-sm-2" for="user1"><?=$lang['add']['username'];?></label>
438 <div class="col-sm-10">
439 <input type="text" class="form-control" name="user1" required>
440 </div>
441 </div>
442 <div class="form-group">
443 <label class="control-label col-sm-2" for="password1"><?=$lang['add']['password'];?></label>
444 <div class="col-sm-10">
445 <input type="password" class="form-control" name="password1" required>
446 </div>
447 </div>
448 <div class="form-group">
449 <label class="control-label col-sm-2" for="enc1"><?=$lang['add']['enc_method'];?></label>
450 <div class="col-sm-10">
451 <select name="enc1" title="<?=$lang['add']['select'];?>" required>
452 <option value="SSL" selected>SSL</option>
453 <option value="TLS">STARTTLS</option>
454 <option value="PLAIN">PLAIN</option>
455 </select>
456 </div>
457 </div>
458 <div class="form-group">
459 <label class="control-label col-sm-2" for="mins_interval"><?=$lang['add']['mins_interval'];?></label>
460 <div class="col-sm-10">
461 <input type="number" class="form-control" name="mins_interval" min="1" max="43800" value="20" required>
462 <small class="help-block">1-43800</small>
463 </div>
464 </div>
465 <div class="form-group">
466 <label class="control-label col-sm-2" for="subfolder2"><?=$lang['edit']['subfolder2'];?></label>
467 <div class="col-sm-10">
468 <input type="text" class="form-control" name="subfolder2" value="">
469 </div>
470 </div>
471 <div class="form-group">
472 <label class="control-label col-sm-2" for="maxage"><?=$lang['edit']['maxage'];?></label>
473 <div class="col-sm-10">
474 <input type="number" class="form-control" name="maxage" min="0" max="32000" value="0">
475 <small class="help-block">0-32000</small>
476 </div>
477 </div>
478 <div class="form-group">
479 <label class="control-label col-sm-2" for="maxbytespersecond"><?=$lang['edit']['maxbytespersecond'];?></label>
480 <div class="col-sm-10">
481 <input type="number" class="form-control" name="maxbytespersecond" min="0" max="125000000" value="0">
482 <small class="help-block">0-125000000</small>
483 </div>
484 </div>
485 <div class="form-group">
486 <label class="control-label col-sm-2" for="timeout1"><?=$lang['edit']['timeout1'];?></label>
487 <div class="col-sm-10">
488 <input type="number" class="form-control" name="timeout1" min="1" max="32000" value="600">
489 <small class="help-block">1-32000</small>
490 </div>
491 </div>
492 <div class="form-group">
493 <label class="control-label col-sm-2" for="timeout2"><?=$lang['edit']['timeout2'];?></label>
494 <div class="col-sm-10">
495 <input type="number" class="form-control" name="timeout2" min="1" max="32000" value="600">
496 <small class="help-block">1-32000</small>
497 </div>
498 </div>
499 <div class="form-group">
500 <label class="control-label col-sm-2" for="exclude"><?=$lang['add']['exclude'];?></label>
501 <div class="col-sm-10">
502 <input type="text" class="form-control" name="exclude" value="(?i)spam|(?i)junk">
503 </div>
504 </div>
505 <div class="form-group">
506 <label class="control-label col-sm-2" for="custom_params"><?=$lang['add']['custom_params'];?></label>
507 <div class="col-sm-10">
508 <input type="text" class="form-control" name="custom_params" placeholder="--dry --some-param=xy --other-param=yx">
509 <small class="help-block"><?=$lang['add']['custom_params_hint'];?></small>
510 </div>
511 </div>
512 <div class="form-group">
513 <div class="col-sm-offset-2 col-sm-10">
514 <div class="checkbox">
515 <label><input type="checkbox" value="1" name="delete2duplicates" checked> <?=$lang['add']['delete2duplicates'];?> (--delete2duplicates)</label>
516 </div>
517 </div>
518 </div>
519 <div class="form-group">
520 <div class="col-sm-offset-2 col-sm-10">
521 <div class="checkbox">
522 <label><input type="checkbox" value="1" name="delete1"> <?=$lang['add']['delete1'];?> (--delete1)</label>
523 </div>
524 </div>
525 </div>
526 <div class="form-group">
527 <div class="col-sm-offset-2 col-sm-10">
528 <div class="checkbox">
529 <label><input type="checkbox" value="1" name="delete2"> <?=$lang['add']['delete2'];?> (--delete2)</label>
530 </div>
531 </div>
532 </div>
533 <div class="form-group">
534 <div class="col-sm-offset-2 col-sm-10">
535 <div class="checkbox">
536 <label><input type="checkbox" value="1" name="automap" checked> <?=$lang['add']['automap'];?> (--automap)</label>
537 </div>
538 </div>
539 </div>
540 <div class="form-group">
541 <div class="col-sm-offset-2 col-sm-10">
542 <div class="checkbox">
543 <label><input type="checkbox" value="1" name="skipcrossduplicates"> <?=$lang['add']['skipcrossduplicates'];?> (--skipcrossduplicates)</label>
544 </div>
545 </div>
546 </div>
547 <div class="form-group">
548 <div class="col-sm-offset-2 col-sm-10">
549 <div class="checkbox">
550 <label><input type="checkbox" value="1" name="subscribeall" checked> <?=$lang['add']['subscribeall'];?> (--subscribeall)</label>
551 </div>
552 </div>
553 </div>
554 <div class="form-group">
555 <div class="col-sm-offset-2 col-sm-10">
556 <div class="checkbox">
557 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
558 </div>
559 </div>
560 </div>
561 <div class="form-group">
562 <div class="col-sm-offset-2 col-sm-10">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200563 <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_syncjob" data-api-url='add/syncjob' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100564 </div>
565 </div>
566 </form>
567 </div>
568 </div>
569 </div>
570</div><!-- add sync job modal -->
571<!-- add add_filter modal -->
572<div class="modal fade" id="addFilterModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
573 <div class="modal-dialog modal-lg">
574 <div class="modal-content">
575 <div class="modal-header">
576 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
577 <h3 class="modal-title">Filter</h3>
578 </div>
579 <div class="modal-body">
580 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_filter">
581 <div class="form-group">
582 <label class="control-label col-sm-2" for="username"><?=$lang['add']['username'];?></label>
583 <div class="col-sm-10">
584 <select data-live-search="true" name="username" required>
585 <?php
586 $domains = mailbox('get', 'domains');
587 if (!empty($domains)) {
588 foreach ($domains as $domain) {
589 $mailboxes = mailbox('get', 'mailboxes', $domain);
590 foreach ($mailboxes as $mailbox) {
591 echo "<option>".htmlspecialchars($mailbox)."</option>";
592 }
593 }
594 }
595 ?>
596 </select>
597 </div>
598 </div>
599 <div class="form-group">
600 <label class="control-label col-sm-2" for="filter_type"><?=$lang['add']['sieve_type'];?></label>
601 <div class="col-sm-10">
602 <select id="addFilterType" name="filter_type" required>
603 <option value="prefilter">Prefilter</option>
604 <option value="postfilter">Postfilter</option>
605 </select>
606 </div>
607 </div>
608 <div class="form-group">
609 <label class="control-label col-sm-2" for="script_desc"><?=$lang['add']['sieve_desc'];?></label>
610 <div class="col-sm-10">
611 <input type="text" class="form-control" id="script_desc" name="script_desc" required maxlength="255">
612 </div>
613 </div>
614 <div class="form-group">
615 <label class="control-label col-sm-2" for="script_data">Script:</label>
616 <div class="col-sm-10">
617 <textarea autocorrect="off" spellcheck="false" autocapitalize="none" class="form-control textarea-code script_data" rows="20" name="script_data" required></textarea>
618 </div>
619 </div>
620 <div class="form-group">
621 <div class="col-sm-offset-2 col-sm-10">
622 <p class="help-block"><?=$lang['add']['activate_filter_warn'];?></p>
623 <div class="checkbox">
624 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
625 </div>
626 </div>
627 </div>
628 <div class="form-group">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200629 <div class="col-sm-offset-2 col-sm-10 add_filter_btns btn-group">
630 <button class="btn btn-xs-lg btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default validate_sieve" href="#"><?=$lang['add']['validate'];?></button>
631 <button class="btn btn-xs-lg btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success add_sieve_script" data-action="add_item" data-id="add_filter" data-api-url='add/filter' data-api-attr='{}' href="#" disabled><?=$lang['admin']['add'];?></button>
632 <div class="clearfix visible-xs"></div>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100633 </div>
634 </div>
635 </form>
636 <?=$lang['mailbox']['sieve_preset_header']?>
637 <ul id="sieve_presets"></ul>
638 </div>
639 </div>
640 </div>
641</div><!-- add add_filter modal -->
642<!-- add add_bcc modal -->
643<div class="modal fade" id="addBCCModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
644 <div class="modal-dialog modal-lg">
645 <div class="modal-content">
646 <div class="modal-header">
647 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
648 <h3 class="modal-title"><?=$lang['mailbox']['bcc_maps'];?></h3>
649 </div>
650 <div class="modal-body">
651 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_bcc">
652 <div class="form-group">
653 <label class="control-label col-sm-2" for="local_dest"><?=$lang['mailbox']['bcc_local_dest'];?></label>
654 <div class="col-sm-10">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200655 <select data-live-search="true" data-size="20" name="local_dest" required>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100656 <?php
657 $domains = mailbox('get', 'domains');
658 $alias_domains = mailbox('get', 'alias_domains');
659 if (!empty($domains)) {
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200660 echo '<optgroup label="',$lang['mailbox']['domains'],'">';
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100661 foreach ($domains as $domain) {
662 echo "<option>".htmlspecialchars($domain)."</option>";
663 }
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200664 echo "</optgroup>";
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100665 }
666 if (!empty($alias_domains)) {
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200667 echo '<optgroup label="',$lang['mailbox']['domain_aliases'],'">';
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100668 foreach ($alias_domains as $alias_domain) {
669 echo "<option>".htmlspecialchars($alias_domain)."</option>";
670 }
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200671 echo "</optgroup>";
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100672 }
673 if (!empty($domains)) {
674 foreach ($domains as $domain) {
675 $mailboxes = mailbox('get', 'mailboxes', $domain);
676 foreach ($mailboxes as $mailbox) {
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200677 echo "<optgroup label=\"" . htmlspecialchars($mailbox) . "\">";
678 echo "<option> " . htmlspecialchars($mailbox) . "</option>";
679 $user_alias_details = user_get_alias_details($mailbox);
680 foreach ($user_alias_details['direct_aliases'] as $k => $v) {
681 echo "<option>" . htmlspecialchars($k) . "</option>";
682 }
683 foreach ($user_alias_details['shared_aliases'] as $k => $v) {
684 echo "<option>" . htmlspecialchars($k) . "</option>";
685 }
686 echo "</optgroup>";
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100687 }
688 }
689 }
690 ?>
691 </select>
692 </div>
693 </div>
694 <div class="form-group">
695 <label class="control-label col-sm-2" for="type"><?=$lang['mailbox']['bcc_map_type'];?></label>
696 <div class="col-sm-10">
697 <select name="type" required>
698 <option value="sender"><?=$lang['mailbox']['bcc_sender_map'];?></option>
699 <option value="rcpt"><?=$lang['mailbox']['bcc_rcpt_map'];?></option>
700 </select>
701 </div>
702 </div>
703 <div class="form-group">
704 <label class="control-label col-sm-2" for="bcc_dest"><?=$lang['mailbox']['bcc_destination'];?></label>
705 <div class="col-sm-10">
706 <input type="text" class="form-control" name="bcc_dest">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200707 <small><?=$lang['add']['bcc_dest_format'];?></small>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100708 </div>
709 </div>
710 <div class="form-group">
711 <div class="col-sm-offset-2 col-sm-10">
712 <div class="checkbox">
713 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
714 </div>
715 </div>
716 </div>
717 <div class="form-group">
718 <div class="col-sm-offset-2 col-sm-10">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200719 <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_bcc" data-api-url='add/bcc' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100720 </div>
721 </div>
722 </form>
723 </div>
724 </div>
725 </div>
726</div><!-- add add_bcc modal -->
727<!-- add add_recipient_map modal -->
728<div class="modal fade" id="addRecipientMapModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
729 <div class="modal-dialog modal-lg">
730 <div class="modal-content">
731 <div class="modal-header">
732 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
733 <h3 class="modal-title"><?=$lang['mailbox']['recipient_maps'];?></h3>
734 </div>
735 <div class="modal-body">
736 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_recipient_map">
737 <div class="form-group">
738 <label class="control-label col-sm-2" for="recipient_map_old"><?=$lang['mailbox']['recipient_map_old'];?></label>
739 <div class="col-sm-10">
740 <input type="text" class="form-control" name="recipient_map_old">
741 <small><?=$lang['mailbox']['recipient_map_old_info'];?></small>
742 </div>
743 </div>
744 <div class="form-group">
745 <label class="control-label col-sm-2" for="recipient_map_new"><?=$lang['mailbox']['recipient_map_new'];?></label>
746 <div class="col-sm-10">
747 <input type="text" class="form-control" name="recipient_map_new">
748 <small><?=$lang['mailbox']['recipient_map_new_info'];?></small>
749 </div>
750 </div>
751 <div class="form-group">
752 <div class="col-sm-offset-2 col-sm-10">
753 <div class="checkbox">
754 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
755 </div>
756 </div>
757 </div>
758 <div class="form-group">
759 <div class="col-sm-offset-2 col-sm-10">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200760 <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_recipient_map" data-api-url='add/recipient_map' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100761 </div>
762 </div>
763 </form>
764 </div>
765 </div>
766 </div>
767</div><!-- add add_recipient_map modal -->
768<!-- add add_tls_policy_map modal -->
769<div class="modal fade" id="addTLSPolicyMapAdmin" tabindex="-1" role="dialog" aria-hidden="true">
770 <div class="modal-dialog modal-lg">
771 <div class="modal-content">
772 <div class="modal-header">
773 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
774 <h3 class="modal-title"><?=$lang['mailbox']['tls_policy_maps'];?></h3>
775 </div>
776 <div class="modal-body">
777 <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_tls_policy_map">
778 <div class="form-group">
779 <label class="control-label col-sm-2" for="dest"><?=$lang['mailbox']['tls_map_dest'];?></label>
780 <div class="col-sm-10">
781 <input type="text" class="form-control" name="dest">
782 <small><?=$lang['mailbox']['tls_map_dest_info'];?></small>
783 </div>
784 </div>
785 <div class="form-group">
786 <label class="control-label col-sm-2" for="policy"><?=$lang['mailbox']['tls_map_policy'];?></label>
787 <div class="col-sm-10">
788 <select class="full-width-select" name="policy" required>
789 <option value="none">none</option>
790 <option value="may">may</option>
791 <option value="encrypt">encrypt</option>
792 <option value="dane">dane</option>
793 <option value="dane-only">dane-only</option>
794 <option value="fingerprint">fingerprint</option>
795 <option value="verify">verify</option>
796 <option value="secure">secure</option>
797 </select>
798 </div>
799 </div>
800 <div class="form-group">
801 <label class="control-label col-sm-2" for="parameters"><?=$lang['mailbox']['tls_map_parameters'];?></label>
802 <div class="col-sm-10">
803 <input type="text" class="form-control" name="parameters">
804 <small><?=$lang['mailbox']['tls_map_parameters_info'];?></small>
805 </div>
806 </div>
807 <div class="form-group">
808 <div class="col-sm-offset-2 col-sm-10">
809 <div class="checkbox">
810 <label><input type="checkbox" value="1" name="active" checked> <?=$lang['add']['active'];?></label>
811 </div>
812 </div>
813 </div>
814 <div class="form-group">
815 <div class="col-sm-offset-2 col-sm-10">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200816 <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_tls_policy_map" data-api-url='add/tls-policy-map' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100817 </div>
818 </div>
819 </form>
820 </div>
821 </div>
822 </div>
823</div><!-- add add_tls_policy_map modal -->
824<!-- log modal -->
825<div class="modal fade" id="syncjobLogModal" tabindex="-1" role="dialog" aria-labelledby="syncjobLogModalLabel">
826 <div class="modal-dialog modal-lg" role="document">
827 <div class="modal-content">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200828 <div class="modal-header">
829 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
830 <h3 class="modal-title">Log</h3>
831 </div>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100832 <div class="modal-body">
833 <textarea class="form-control" rows="20" id="logText" spellcheck="false"></textarea>
834 </div>
835 </div>
836 </div>
837</div><!-- log modal -->
838<!-- DNS info modal -->
839<div class="modal fade" id="dnsInfoModal" tabindex="-1" role="dialog" aria-labelledby="dnsInfoModalLabel">
840 <div class="modal-dialog modal-lg" role="document">
841 <div class="modal-content">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200842 <div class="modal-header">
843 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
844 <h3 class="modal-title"><?=$lang['diagnostics']['dns_records'];?></h3>
845 </div>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100846 <div class="modal-body">
847 <p><?=$lang['diagnostics']['dns_records_24hours'];?></p>
848 <div class="dns-modal-body"></div>
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200849 <p><?=$lang['diagnostics']['dns_records_docs'];?></p>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100850 </div>
851 </div>
852 </div>
853</div><!-- DNS info modal -->