edit page for default domain and mailbox settings
This commit is contained in:
		| @@ -38,24 +38,36 @@ if (isset($_SESSION['mailcow_cc_role'])) { | ||||
|       $template = 'edit/admin.twig'; | ||||
|       $template_data = ['admin' => $admin]; | ||||
|     } | ||||
|     elseif (isset($_GET['domain']) && | ||||
|       is_valid_domain_name($_GET["domain"]) && | ||||
|       !empty($_GET["domain"])) { | ||||
|         $domain = $_GET["domain"]; | ||||
|         $result = mailbox('get', 'domain_details', $domain); | ||||
|         $quota_notification_bcc = quota_notification_bcc('get', $domain); | ||||
|         $rl = ratelimit('get', 'domain', $domain); | ||||
|         $rlyhosts = relayhost('get'); | ||||
|         $template = 'edit/domain.twig'; | ||||
|         $template_data = [ | ||||
|           'acl' => $_SESSION['acl'], | ||||
|           'domain' => $domain, | ||||
|           'quota_notification_bcc' => $quota_notification_bcc, | ||||
|           'rl' => $rl, | ||||
|           'rlyhosts' => $rlyhosts, | ||||
|           'dkim' => dkim('details', $domain), | ||||
|           'domain_details' => $result, | ||||
|         ]; | ||||
|     elseif (isset($_GET['domain'])) { | ||||
|       if ($_GET['domain'] == "defaults") { | ||||
|           // edit domain default settings | ||||
|           //$result = mailbox('get', 'domain_defaults'); | ||||
|           //$rl = ratelimit('get', 'domain_defaults'); | ||||
|           $result = true; | ||||
|           $template = 'edit/domain-defaults.twig'; | ||||
|           $template_data = [ | ||||
|           //  'rl' => $rl, | ||||
|           ]; | ||||
|       } | ||||
|       elseif (is_valid_domain_name($_GET["domain"]) && | ||||
|         !empty($_GET["domain"])) { | ||||
|           // edit domain | ||||
|           $domain = $_GET["domain"]; | ||||
|           $result = mailbox('get', 'domain_details', $domain); | ||||
|           $quota_notification_bcc = quota_notification_bcc('get', $domain); | ||||
|           $rl = ratelimit('get', 'domain', $domain); | ||||
|           $rlyhosts = relayhost('get'); | ||||
|           $template = 'edit/domain.twig'; | ||||
|           $template_data = [ | ||||
|             'acl' => $_SESSION['acl'], | ||||
|             'domain' => $domain, | ||||
|             'quota_notification_bcc' => $quota_notification_bcc, | ||||
|             'rl' => $rl, | ||||
|             'rlyhosts' => $rlyhosts, | ||||
|             'dkim' => dkim('details', $domain), | ||||
|             'domain_details' => $result, | ||||
|           ]; | ||||
|       } | ||||
|     } | ||||
|     elseif (isset($_GET['oauth2client']) && | ||||
|       is_numeric($_GET["oauth2client"]) && | ||||
| @@ -79,29 +91,42 @@ if (isset($_SESSION['mailcow_cc_role'])) { | ||||
|           'dkim' => dkim('details', $alias_domain), | ||||
|         ]; | ||||
|     } | ||||
|     elseif (isset($_GET['mailbox']) && filter_var(html_entity_decode(rawurldecode($_GET["mailbox"])), FILTER_VALIDATE_EMAIL) && !empty($_GET["mailbox"])) { | ||||
|       $mailbox = html_entity_decode(rawurldecode($_GET["mailbox"])); | ||||
|       $result = mailbox('get', 'mailbox_details', $mailbox); | ||||
|       $rl = ratelimit('get', 'mailbox', $mailbox); | ||||
|       $pushover_data = pushover('get', $mailbox); | ||||
|       $quarantine_notification = mailbox('get', 'quarantine_notification', $mailbox); | ||||
|       $quarantine_category = mailbox('get', 'quarantine_category', $mailbox); | ||||
|       $get_tls_policy = mailbox('get', 'tls_policy', $mailbox); | ||||
|       $rlyhosts = relayhost('get'); | ||||
|       $template = 'edit/mailbox.twig'; | ||||
|       $template_data = [ | ||||
|         'acl' => $_SESSION['acl'], | ||||
|         'mailbox' => $mailbox, | ||||
|         'rl' => $rl, | ||||
|         'pushover_data' => $pushover_data, | ||||
|         'quarantine_notification' => $quarantine_notification, | ||||
|         'quarantine_category' => $quarantine_category, | ||||
|         'get_tls_policy' => $get_tls_policy, | ||||
|         'rlyhosts' => $rlyhosts, | ||||
|         'sender_acl_handles' => mailbox('get', 'sender_acl_handles', $mailbox), | ||||
|         'user_acls' => acl('get', 'user', $mailbox), | ||||
|         'mailbox_details' => $result | ||||
|       ]; | ||||
|     elseif (isset($_GET['mailbox'])){ | ||||
|       if ($_GET['mailbox'] == "defaults"){ | ||||
|         // edit mailbox default settings | ||||
|         // $result = mailbox('get', 'mailbox_defaults'); | ||||
|         // $rl = ratelimit('get', 'mailbox_defaults'); | ||||
|         $result = true; | ||||
|         $template = 'edit/mailbox-defaults.twig'; | ||||
|         $template_data = [ | ||||
|         //  'rl' => $rl, | ||||
|         ]; | ||||
|       } | ||||
|       elseif(filter_var(html_entity_decode(rawurldecode($_GET["mailbox"])), FILTER_VALIDATE_EMAIL) && !empty($_GET["mailbox"])) { | ||||
|         // edit mailbox | ||||
|         $mailbox = html_entity_decode(rawurldecode($_GET["mailbox"])); | ||||
|         $result = mailbox('get', 'mailbox_details', $mailbox); | ||||
|         $rl = ratelimit('get', 'mailbox', $mailbox); | ||||
|         $pushover_data = pushover('get', $mailbox); | ||||
|         $quarantine_notification = mailbox('get', 'quarantine_notification', $mailbox); | ||||
|         $quarantine_category = mailbox('get', 'quarantine_category', $mailbox); | ||||
|         $get_tls_policy = mailbox('get', 'tls_policy', $mailbox); | ||||
|         $rlyhosts = relayhost('get'); | ||||
|         $template = 'edit/mailbox.twig'; | ||||
|         $template_data = [ | ||||
|           'acl' => $_SESSION['acl'], | ||||
|           'mailbox' => $mailbox, | ||||
|           'rl' => $rl, | ||||
|           'pushover_data' => $pushover_data, | ||||
|           'quarantine_notification' => $quarantine_notification, | ||||
|           'quarantine_category' => $quarantine_category, | ||||
|           'get_tls_policy' => $get_tls_policy, | ||||
|           'rlyhosts' => $rlyhosts, | ||||
|           'sender_acl_handles' => mailbox('get', 'sender_acl_handles', $mailbox), | ||||
|           'user_acls' => acl('get', 'user', $mailbox), | ||||
|           'mailbox_details' => $result | ||||
|         ]; | ||||
|       } | ||||
|     } | ||||
|     elseif (isset($_GET['relayhost']) && is_numeric($_GET["relayhost"]) && !empty($_GET["relayhost"])) { | ||||
|         $relayhost = intval($_GET["relayhost"]); | ||||
|   | ||||
							
								
								
									
										156
									
								
								data/web/templates/edit/domain-defaults.twig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										156
									
								
								data/web/templates/edit/domain-defaults.twig
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,156 @@ | ||||
| {% extends 'edit.twig' %} | ||||
|  | ||||
| {% block inner_content %} | ||||
| {% if result %} | ||||
| <ul class="nav nav-tabs" role="tablist"> | ||||
|   <li role="presentation" class="nav-item"><button class="nav-link active" data-bs-toggle="tab" data-bs-target="#dedit">{{ lang.edit.domain }}</button></li> | ||||
|   <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#dratelimit">{{ lang.edit.ratelimit }}</button></li> | ||||
|   <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#dspamfilter">{{ lang.edit.spam_filter }}</button></li> | ||||
|   <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#dqwbcc">{{ lang.edit.quota_warning_bcc }}</button></li> | ||||
| </ul> | ||||
| <hr> | ||||
| <div class="tab-content"> | ||||
|   <div id="dedit" class="tab-pane fade show active" role="tabpanel" aria-labelledby="domain-edit"> | ||||
|     <form data-id="editdomain" class="form-horizontal" role="form" method="post"> | ||||
|       <input type="hidden" value="0" name="active"> | ||||
|       <input type="hidden" value="0" name="backupmx"> | ||||
|       <input type="hidden" value="0" name="gal"> | ||||
|       <input type="hidden" value="0" name="relay_all_recipients"> | ||||
|       <input type="hidden" value="0" name="relay_unknown_only"> | ||||
|       {% if mailcow_cc_role == 'admin' %} | ||||
|       <div class="row mb-2"> | ||||
|         <label class="control-label col-sm-2" for="aliases">{{ lang.edit.max_aliases }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <input type="number" class="form-control" name="aliases" value="{{ result.max_num_aliases_for_domain }}"> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row mb-2"> | ||||
|         <label class="control-label col-sm-2" for="mailboxes">{{ lang.edit.max_mailboxes }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <input type="number" class="form-control" name="mailboxes" value="{{ result.max_num_mboxes_for_domain }}"> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row mb-2"> | ||||
|         <label class="control-label col-sm-2" for="defquota">{{ lang.edit.mailbox_quota_def }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <input type="number" class="form-control" name="defquota" value="{{ (result.def_quota_for_mbox / 1048576) }}"> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row mb-2"> | ||||
|         <label class="control-label col-sm-2" for="maxquota">{{ lang.edit.max_quota }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <input type="number" class="form-control" name="maxquota" value="{{ (result.max_quota_for_mbox / 1048576) }}"> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row mb-4"> | ||||
|         <label class="control-label col-sm-2" for="quota">{{ lang.edit.domain_quota }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <input type="number" class="form-control" name="quota" value="{{ (result.max_quota_for_domain / 1048576) }}"> | ||||
|         </div> | ||||
|       </div> | ||||
|       {% endif %} | ||||
|       <hr> | ||||
|       <div class="row mb-2"> | ||||
|         <div class="offset-sm-2 col-sm-10"> | ||||
|           <div class="checkbox"> | ||||
|             <label><input type="checkbox" value="1" name="active"{% if result.active == '1' %} checked{% endif %}{% if mailcow_cc_role != 'admin' %} disabled{% endif %}> {{ lang.edit.active }}</label> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row"> | ||||
|         <div class="offset-sm-2 col-sm-10"> | ||||
|           <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="editdomain" data-item="{{ domain }}" data-api-url='edit/domain' data-api-attr='{}' href="#">{{ lang.admin.save }}</button> | ||||
|         </div> | ||||
|       </div> | ||||
|     </form> | ||||
|   </div> | ||||
|   <div id="dratelimit" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-ratelimit"> | ||||
|     <form data-id="domratelimit" class="form-inline well" method="post"> | ||||
|       <div class="row"> | ||||
|         <div class="col-12"> | ||||
|           <label class="control-label mb-2">{{ lang.edit.ratelimit }}</label> | ||||
|           <input name="rl_value" type="number" value="{{ rl.value }}" autocomplete="off" class="form-control mb-4" placeholder="{{ lang.ratelimit.disabled }}"> | ||||
|           <select name="rl_frame" class="form-control"> | ||||
|             {% include 'mailbox/rl-frame.twig' %} | ||||
|           </select> | ||||
|           <button data-acl="{{ acl.ratelimit }}" class="btn btn-xs-lg d-block d-sm-inline btn-secondary" data-action="edit_selected" data-id="domratelimit" data-item="{{ domain }}" data-api-url='edit/rl-domain' data-api-attr='{}' href="#">{{ lang.admin.save }}</button> | ||||
|         </div> | ||||
|       </div> | ||||
|     </form> | ||||
|   </div> | ||||
|   <div id="dspamfilter" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-spamfilter"> | ||||
|     <div class="row"> | ||||
|       <div class="col-sm-6"> | ||||
|         <h4>{{ lang.user.spamfilter_wl }}</h4> | ||||
|         <p>{{ lang.user.spamfilter_wl_desc|raw }}</p> | ||||
|         <form class="form-inline mb-4" data-id="add_wl_policy_domain"> | ||||
|           <div class="input-group" data-acl="{{ acl.spam_policy }}"> | ||||
|             <input type="text" class="form-control" name="object_from" placeholder="*@example.org" required> | ||||
|             <span class="input-group-btn"> | ||||
|                       <button class="btn btn-secondary" data-action="add_item" data-id="add_wl_policy_domain" data-api-url='add/domain-policy' data-api-attr='{"domain":"{{ domain }}","object_list":"wl"}' href="#">{{ lang.user.spamfilter_table_add }}</button> | ||||
|                     </span> | ||||
|           </div> | ||||
|         </form> | ||||
|         <table id="wl_policy_domain_table" class="table table-striped dt-responsive w-100"></table> | ||||
|         <div class="mass-actions-user"> | ||||
|           <div class="btn-group" data-acl="{{ acl.spam_policy }}"> | ||||
|             <a class="btn btn-xs-half d-block d-sm-inline btn-sm btn-secondary" id="toggle_multi_select_all" data-id="policy_wl_domain" href="#"><i class="bi bi-check-all"></i> {{ lang.mailbox.toggle_all }}</a> | ||||
|             <a class="btn btn-xs-half d-block d-sm-inline btn-sm btn-danger" data-action="delete_selected" data-id="policy_wl_domain" data-api-url='delete/domain-policy' href="#">{{ lang.mailbox.remove }}</a> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="col-sm-6"> | ||||
|         <h4>{{ lang.user.spamfilter_bl }}</h4> | ||||
|         <p>{{ lang.user.spamfilter_bl_desc|raw }}</p> | ||||
|         <form class="form-inline mb-4" data-id="add_bl_policy_domain"> | ||||
|           <div class="input-group" data-acl="{{ acl.spam_policy }}"> | ||||
|             <input type="text" class="form-control" name="object_from" placeholder="*@example.org" required> | ||||
|             <span class="input-group-btn"> | ||||
|                       <button class="btn btn-secondary" data-action="add_item" data-id="add_bl_policy_domain" data-api-url='add/domain-policy' data-api-attr='{"domain":"{{ domain }}","object_list":"bl"}' href="#">{{ lang.user.spamfilter_table_add }}</button> | ||||
|                     </span> | ||||
|           </div> | ||||
|         </form> | ||||
|         <table id="bl_policy_domain_table" class="table table-striped dt-responsive w-100"></table> | ||||
|         <div class="mass-actions-user"> | ||||
|           <div class="btn-group" data-acl="{{ acl.spam_policy }}"> | ||||
|             <a class="btn btn-xs-half d-block d-sm-inline btn-sm btn-secondary" id="toggle_multi_select_all" data-id="policy_bl_domain" href="#"><i class="bi bi-check-all"></i> {{ lang.mailbox.toggle_all }}</a> | ||||
|             <a class="btn btn-xs-half d-block d-sm-inline btn-sm btn-danger" data-action="delete_selected" data-id="policy_bl_domain" data-api-url='delete/domain-policy' href="#">{{ lang.mailbox.remove }}</a></li> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div id="dqwbcc" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-qwbcc"> | ||||
|     <div class="row"> | ||||
|       <div class="col-sm-12"> | ||||
|         <h4>{{ lang.edit.quota_warning_bcc }}</h4> | ||||
|         <p>{{ lang.edit.quota_warning_bcc_info|raw }}</p> | ||||
|         <form class="form-horizontal" data-id="quota_bcc"> | ||||
|           <input type="hidden" value="0" name="active"> | ||||
|           <div class="row mb-2"> | ||||
|             <label class="control-label col-sm-2" for="script_data">{{ lang.edit.target_address|raw }}:</label> | ||||
|             <div class="col-sm-10"> | ||||
|               <textarea spellcheck="false" autocorrect="off" autocapitalize="none" class="form-control" rows="10" id="bcc_rcpt" name="bcc_rcpt">{{ quota_notification_bcc.bcc_rcpts|join("\n") }}</textarea> | ||||
|             </div> | ||||
|           </div> | ||||
|           <div class="row mb-4"> | ||||
|             <div class="offset-sm-2 col-sm-10"> | ||||
|               <div class="checkbox"> | ||||
|                 <label><input type="checkbox" value="1" name="active"{% if quota_notification_bcc.active == '1' %} checked{% endif %}> {{ lang.edit.active }}</label> | ||||
|               </div> | ||||
|             </div> | ||||
|           </div> | ||||
|           <div class="row"> | ||||
|             <div class="offset-sm-2 col-sm-10"> | ||||
|               <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="quota_bcc" data-item="quota_bcc" data-api-url='edit/quota_notification_bcc' data-api-attr='{"domain":"{{ domain }}"}' href="#">{{ lang.edit.save }}</button> | ||||
|             </div> | ||||
|           </div> | ||||
|         </form> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| </div> | ||||
| {% else %} | ||||
|   {{ parent() }} | ||||
| {% endif %} | ||||
| {% endblock %} | ||||
							
								
								
									
										195
									
								
								data/web/templates/edit/mailbox-defaults.twig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										195
									
								
								data/web/templates/edit/mailbox-defaults.twig
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,195 @@ | ||||
| {% extends 'edit.twig' %} | ||||
|  | ||||
| {% block inner_content %} | ||||
| {% if result %} | ||||
| <ul class="nav nav-tabs" role="tablist"> | ||||
|   <li role="presentation" class="nav-item"><button class="nav-link active" data-bs-toggle="tab" data-bs-target="#medit">{{ lang.edit.mailbox }}</button></li> | ||||
|   <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#macl">{{ lang.edit.acl }}</button></li> | ||||
|   <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#mrl">{{ lang.edit.ratelimit }}</button></li> | ||||
| </ul> | ||||
| <hr> | ||||
| <div class="tab-content"> | ||||
|   <div id="medit" class="tab-pane fade show active" role="tabpanel" aria-labelledby="mailbox-edit"> | ||||
|     <form class="form-horizontal" data-id="editmailbox" role="form" method="post"> | ||||
|       <input type="hidden" value="default" name="sender_acl"> | ||||
|       <input type="hidden" value="0" name="force_pw_update"> | ||||
|       <input type="hidden" value="0" name="sogo_access"> | ||||
|       <input type="hidden" value="0" name="protocol_access"> | ||||
|       <div class="row mb-2"> | ||||
|         <label class="control-label col-sm-2" for="quota"> | ||||
|           {{ lang.edit.quota_mb }} | ||||
|         </label> | ||||
|         <div class="col-sm-10"> | ||||
|           <input type="number" name="quota" style="width:100%" min="0" max="{{ (result.max_new_quota / 1048576) }}" value="{{ (result.quota / 1048576) }}" class="form-control"> | ||||
|           <small class="text-muted">0 = ∞</small> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row mb-2"> | ||||
|         <label class="control-label col-sm-2">{{ lang.user.quarantine_notification }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <div class="btn-group" data-acl="{{ acl.quarantine_notification }}"> | ||||
|             <button type="button" class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary{% if quarantine_notification == 'never' %} active{% endif %}" | ||||
|             data-action="edit_selected" | ||||
|             data-item="{{ mailbox }}" | ||||
|             data-id="quarantine_notification" | ||||
|             data-api-url='edit/quarantine_notification' | ||||
|             data-api-attr='{"quarantine_notification":"never"}'>{{ lang.user.never }}</button> | ||||
|             <button type="button" class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary{% if quarantine_notification == 'hourly' %} active{% endif %}" | ||||
|             data-action="edit_selected" | ||||
|             data-item="{{ mailbox }}" | ||||
|             data-id="quarantine_notification" | ||||
|             data-api-url='edit/quarantine_notification' | ||||
|             data-api-attr='{"quarantine_notification":"hourly"}'>{{ lang.user.hourly }}</button> | ||||
|             <button type="button" class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary{% if quarantine_notification == 'daily' %} active{% endif %}" | ||||
|             data-action="edit_selected" | ||||
|             data-item="{{ mailbox }}" | ||||
|             data-id="quarantine_notification" | ||||
|             data-api-url='edit/quarantine_notification' | ||||
|             data-api-attr='{"quarantine_notification":"daily"}'>{{ lang.user.daily }}</button> | ||||
|             <button type="button" class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary{% if quarantine_notification == 'weekly' %} active{% endif %}" | ||||
|             data-action="edit_selected" | ||||
|             data-item="{{ mailbox }}" | ||||
|             data-id="quarantine_notification" | ||||
|             data-api-url='edit/quarantine_notification' | ||||
|             data-api-attr='{"quarantine_notification":"weekly"}'>{{ lang.user.weekly }}</button> | ||||
|           </div> | ||||
|           <p class="text-muted"><small>{{ lang.user.quarantine_notification_info }}</small></p> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row mb-2"> | ||||
|         <label class="control-label col-sm-2">{{ lang.user.quarantine_category }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <div class="btn-group" data-acl="{{ acl.quarantine_category }}"> | ||||
|             <button type="button" class="btn btn-sm btn-xs-third d-block d-sm-inline btn-secondary{% if quarantine_category == 'reject' %} active{% endif %}" | ||||
|             data-action="edit_selected" | ||||
|             data-item="{{ mailbox }}" | ||||
|             data-id="quarantine_category" | ||||
|             data-api-url='edit/quarantine_category' | ||||
|             data-api-attr='{"quarantine_category":"reject"}'>{{ lang.user.q_reject }}</button> | ||||
|             <button type="button" class="btn btn-sm btn-xs-third d-block d-sm-inline btn-secondary{% if quarantine_category == 'add_header' %} active{% endif %}" | ||||
|             data-action="edit_selected" | ||||
|             data-item="{{ mailbox }}" | ||||
|             data-id="quarantine_category" | ||||
|             data-api-url='edit/quarantine_category' | ||||
|             data-api-attr='{"quarantine_category":"add_header"}'>{{ lang.user.q_add_header }}</button> | ||||
|             <button type="button" class="btn btn-sm btn-xs-third d-block d-sm-inline btn-secondary{% if quarantine_category == 'all' %} active{% endif %}" | ||||
|             data-action="edit_selected" | ||||
|             data-item="{{ mailbox }}" | ||||
|             data-id="quarantine_category" | ||||
|             data-api-url='edit/quarantine_category' | ||||
|             data-api-attr='{"quarantine_category":"all"}'>{{ lang.user.q_all }}</button> | ||||
|           </div> | ||||
|           <p class="text-muted"><small>{{ lang.user.quarantine_category_info }}</small></p> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row mb-4"> | ||||
|         <label class="control-label col-sm-2" for="sender_acl">{{ lang.user.tls_policy }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <div class="btn-group" data-acl="{{ acl.tls_policy }}"> | ||||
|             <button type="button" class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary{% if get_tls_policy.tls_enforce_in == '1' %} active"{% endif %}" | ||||
|               data-action="edit_selected" | ||||
|               data-item="{{ mailbox }}" | ||||
|               data-id="tls_policy" | ||||
|               data-api-url='edit/tls_policy' | ||||
|               data-api-attr='{"tls_enforce_in": {% if get_tls_policy.tls_enforce_in == '1' %}0{% else %}1{% endif %} }'>{{ lang.user.tls_enforce_in }}</button> | ||||
|             <button type="button" class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary{% if get_tls_policy.tls_enforce_out == '1' %} active"{% endif %}" | ||||
|               data-action="edit_selected" | ||||
|               data-item="{{ mailbox }}" | ||||
|               data-id="tls_policy" | ||||
|               data-api-url='edit/tls_policy' | ||||
|               data-api-attr='{"tls_enforce_out": {% if get_tls_policy.tls_enforce_out == '1' %}0{% else %}1{% endif %} }'>{{ lang.user.tls_enforce_out }}</button> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row"> | ||||
|         <label class="control-label col-sm-2" for="protocol_access">{{ lang.edit.allowed_protocols }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <select data-acl="{{ acl.protocol_access }}" name="protocol_access" multiple class="form-control"> | ||||
|             <option value="imap"{% if result.attributes.imap_access == '1' %} selected{% endif %}>IMAP</option> | ||||
|             <option value="pop3"{% if result.attributes.pop3_access == '1' %} selected{% endif %}>POP3</option> | ||||
|             <option value="smtp"{% if result.attributes.smtp_access == '1' %} selected{% endif %}>SMTP</option> | ||||
|             <option value="sieve"{% if result.attributes.sieve_access == '1' %} selected{% endif %}>Sieve</option> | ||||
|           </select> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div hidden data-acl="{{ acl.smtp_ip_access }}" class="row"> | ||||
|         <label class="control-label col-sm-2" for="allow_from_smtp">{{ lang.edit.allow_from_smtp }}</label> | ||||
|         <div class="col-sm-10"> | ||||
|           <input type="text" class="form-control" name="allow_from_smtp" value="{{ allow_from_smtp }}" placeholder="1.1.1.1, 10.2.0.0/24, ..."> | ||||
|           <small class="text-muted">{{ lang.edit.allow_from_smtp_info }}</small> | ||||
|         </div> | ||||
|       </div> | ||||
|       <hr> | ||||
|       <div class="row my-2"> | ||||
|         <div class="offset-sm-2 col-sm-10"> | ||||
|           <select name="active" class="form-control"> | ||||
|             <option value="1"{% if result.active == '1' %} selected{% endif %}>{{ lang.edit.active }}</option> | ||||
|             <option value="2"{% if result.active == '2' %} selected{% endif %}>{{ lang.edit.disable_login }}</option> | ||||
|             <option value="0"{% if result.active == '0' %} selected{% endif %}>{{ lang.edit.inactive }}</option> | ||||
|           </select> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="row"> | ||||
|         <div class="offset-sm-2 col-sm-10"> | ||||
|           <div class="checkbox"> | ||||
|             <label><input type="checkbox" value="1" name="force_pw_update"{% if result.attributes.force_pw_update == '1' %} checked{% endif %}> {{ lang.edit.force_pw_update }}</label> | ||||
|             <small class="text-muted">{{ lang.edit.force_pw_update_info|format(ui_texts.main_name) }}</small> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       {% if not skip_sogo %} | ||||
|       <div data-acl="{{ acl.sogo_access }}" class="row"> | ||||
|         <div class="offset-sm-2 col-sm-10"> | ||||
|           <div class="checkbox"> | ||||
|             <label><input type="checkbox" value="1" name="sogo_access"{% if result.attributes.sogo_access == '1' %} checked{% endif %}> {{ lang.edit.sogo_access }}</label> | ||||
|             <small class="text-muted">{{ lang.edit.sogo_access_info }}</small> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       {% endif %} | ||||
|       <div class="row my-2"> | ||||
|         <div class="offset-sm-2 col-sm-10"> | ||||
|           <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="editmailbox" data-item="{{ result.username }}" data-api-url='edit/mailbox' data-api-attr='{}' href="#">{{ lang.edit.save }}</button> | ||||
|         </div> | ||||
|       </div> | ||||
|     </form> | ||||
|   </div> | ||||
|   <div id="macl" class="tab-pane fade" role="tabpanel" aria-labelledby="mailbox-acl"> | ||||
|     <form data-id="useracl" class="form-inline well" method="post"> | ||||
|       <div class="row"> | ||||
|         <div class="col-sm-1"> | ||||
|           <p class="text-muted">ACL</p> | ||||
|         </div> | ||||
|         <div class="col-sm-10"> | ||||
|           <select id="user_acl" name="user_acl" size="10" multiple> | ||||
|             {% for acl, val in user_acls %} | ||||
|               <option value="{{ acl }}"{% if val == 1 %} selected{% endif %}>{{ lang.acl[acl] }}</option> | ||||
|             {% endfor %} | ||||
|           </select> | ||||
|           <button class="btn btn-xs-lg d-block d-sm-inline btn-secondary" data-action="edit_selected" data-id="useracl" data-item="{{ mailbox }}" data-api-url='edit/user-acl' data-api-attr='{}' href="#">{{ lang.edit.save }}</button> | ||||
|         </div> | ||||
|       </div> | ||||
|     </form> | ||||
|   </div> | ||||
|   <div id="mrl" class="tab-pane fade" role="tabpanel" aria-labelledby="mailbox-rl"> | ||||
|     <form data-id="mboxratelimit" class="form-inline well" method="post"> | ||||
|       <div class="row"> | ||||
|         <div class="col-sm-1"> | ||||
|           <p class="text-muted">{{ lang.acl.ratelimit }}</p> | ||||
|         </div> | ||||
|         <div class="col-sm-10"> | ||||
|           <input name="rl_value" type="number" autocomplete="off" value="{{ rl.value }}" class="form-control mb-4" placeholder="{{ lang.ratelimit.disabled }}"> | ||||
|           <select name="rl_frame" class="form-control"> | ||||
|             {% include 'mailbox/rl-frame.twig' %} | ||||
|           </select> | ||||
|           <button class="btn btn-xs-lg d-block d-sm-inline btn-secondary" data-action="edit_selected" data-id="mboxratelimit" data-item="{{ mailbox }}" data-api-url='edit/rl-mbox' data-api-attr='{}' href="#">{{ lang.edit.save }}</button> | ||||
|           <p class="text-muted mt-3">{{ lang.edit.mbox_rl_info }}</p> | ||||
|         </div> | ||||
|       </div> | ||||
|     </form> | ||||
|   </div> | ||||
| </div> | ||||
| {% else %} | ||||
|   {{ parent() }} | ||||
| {% endif %} | ||||
| {% endblock %} | ||||
| @@ -7,7 +7,7 @@ | ||||
|     <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#">{{ lang.mailbox.domains }}</a> | ||||
|     <ul class="dropdown-menu"> | ||||
|       <li><button class="dropdown-item" aria-selected="false" aria-controls="tab-mailboxes" role="tab" data-bs-toggle="tab" data-bs-target="#tab-domains">{{ lang.mailbox.domains }}</button></li> | ||||
|       <li><button class="dropdown-item" aria-selected="false" aria-controls="tab-mailbox-defaults" role="tab" data-bs-toggle="tab" data-bs-target="#tab-mailbox-defaults">Default settings</button></li> | ||||
|       <li><a href="/edit/domain/defaults" class="dropdown-item" aria-selected="false" aria-controls="tab-domain-defaults" role="tab">{{ lang.mailbox.mailbox_defaults }}</a></li> | ||||
|     </ul> | ||||
|     </li> | ||||
|     {# <li class="nav-item" role="presentation"><button class="nav-link active" aria-selected="false" aria-controls="tab-domains" role="tab" data-bs-toggle="tab" data-bs-target="#tab-domains">{{ lang.mailbox.domains }}</button></li> #} | ||||
| @@ -16,7 +16,7 @@ | ||||
|     <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#">{{ lang.mailbox.mailboxes }}</a> | ||||
|     <ul class="dropdown-menu"> | ||||
|       <li><button class="dropdown-item" aria-selected="false" aria-controls="tab-mailboxes" role="tab" data-bs-toggle="tab" data-bs-target="#tab-mailboxes">{{ lang.mailbox.mailboxes }}</button></li> | ||||
|       <li><button class="dropdown-item" aria-selected="false" aria-controls="tab-mailbox-defaults" role="tab" data-bs-toggle="tab" data-bs-target="#tab-mailbox-defaults">{{ lang.mailbox.mailbox_defaults }}</button></li> | ||||
|       <li><a href="/edit/mailbox/defaults" class="dropdown-item" aria-selected="false" aria-controls="tab-mailbox-defaults" role="tab">{{ lang.mailbox.mailbox_defaults }}</a></li> | ||||
|     </ul> | ||||
|     </li> | ||||
|     <li class="nav-item" role="presentation"><button class="nav-link" aria-controls="tab-resources" role="tab" data-bs-toggle="tab" data-bs-target="#tab-resources">{{ lang.mailbox.resources }}</button></li> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user