blob: 0221a8e71fa758426d1f76a86b1485d22b4ea5db [file] [log] [blame]
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01001<div role="tabpanel" class="tab-pane fade show active" id="tab-config-admins" role="tabpanel" aria-labelledby="tab-config-admins">
2 <div class="card mb-4">
3 <div class="card-header bg-danger text-white d-flex fs-5">
4 <button class="btn d-md-none text-white flex-grow-1 text-start" data-bs-target="#collapse-tab-config-admins" data-bs-toggle="collapse" aria-controls="collapse-tab-config-admins">
5 {{ lang.admin.admin_details }}
6 </button>
7 <span class="d-none d-md-block">{{ lang.admin.admin_details }}</span>
8 </div>
9 <div id="collapse-tab-config-admins" class="card-body collapse show" data-bs-parent="#admin-content">
10 <table id="adminstable" class="table table-striped dt-responsive w-100"></table>
11 <div class="mass-actions-admin mb-4">
12 <div class="btn-group">
13 <a class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary" id="toggle_multi_select_all" data-id="admins" href="#"><i class="bi bi-check-all"></i> {{ lang.mailbox.toggle_all }}</a>
14 <a class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary dropdown-toggle" data-bs-toggle="dropdown" href="#">{{ lang.mailbox.quick_actions }}</a>
15 <ul class="dropdown-menu">
16 <li><a class="dropdown-item" data-action="edit_selected" data-id="admins" data-api-url='edit/admin' data-api-attr='{"active":"1"}' href="#">{{ lang.mailbox.activate }}</a></li>
17 <li><a class="dropdown-item" data-action="edit_selected" data-id="admins" data-api-url='edit/admin' data-api-attr='{"active":"0"}' href="#">{{ lang.mailbox.deactivate }}</a></li>
18 <li><hr class="dropdown-divider"></li>
19 <li><a class="dropdown-item" data-action="edit_selected" data-id="admins" data-api-url='edit/admin' data-api-attr='{"disable_tfa":"1"}' href="#">{{ lang.tfa.disable_tfa }}</a></li>
20 <li><hr class="dropdown-divider"></li>
21 <li><a class="dropdown-item" data-action="delete_selected" data-id="admins" data-api-url='delete/admin' href="#">{{ lang.mailbox.remove }}</a></li>
22 </ul>
23 <a class="btn btn-sm d-block d-sm-inline btn-success" data-id="add_admin" data-bs-toggle="modal" data-bs-target="#addAdminModal" href="#"><i class="bi bi-person-plus-fill"></i> {{ lang.admin.add_admin }}</a>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010024 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010025 </div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010026
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010027 {# TFA #}
28 <legend style="margin-top:20px">
29 {{ lang.tfa.tfa }}
30 </legend>
31 <hr />
32 <div class="row">
33 <div class="col-sm-3 col-5 text-end">{{ lang.tfa.tfa }}:</div>
34 <div class="col-sm-9 col-7">
35 {% include 'tfa_keys.twig' %}
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010036 <br>
37 </div>
38 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010039 <div class="row mb-3">
40 <div class="col-sm-3 col-5 text-end">{{ lang.tfa.set_tfa }}:</div>
41 <div class="col-sm-9 col-7">
42 <select data-style="btn btn-sm dropdown-toggle bs-placeholder btn-secondary" data-width="fit" id="selectTFA" class="selectpicker" title="{{ lang.tfa.select }}">
43 <option value="yubi_otp">{{ lang.tfa.yubi_otp }}</option>
44 <option value="webauthn">{{ lang.tfa.webauthn }}</option>
45 <option value="totp">{{ lang.tfa.totp }}</option>
46 <option value="none">{{ lang.tfa.none }}</option>
47 </select>
48 </div>
49 </div>
50
51 {# FIDO2 #}
52 <legend style="margin-top:20px">
53 <i class="bi bi-shield-fill-check"></i>
54 {{ lang.fido2.fido2_auth }}</legend><hr />
55 <div class="row mb-3">
56 <div class="col-sm-3 col-12 text-sm-end text-start mb-4">{{ lang.fido2.known_ids }}:</div>
57 <div class="col-sm-9 col-12">
58 <div class="table-responsive">
59 <table class="table table-striped table-hover table-condensed" id="fido2_keys">
60 <tr>
61 <th>ID</th>
62 <th style="min-width:240px;text-align: right">{{ lang.admin.action }}</th>
63 </tr>
64 {% include 'fido2.twig' %}
65 </table>
66 </div>
67 </div>
68 <br>
69 </div>
70
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010071 <div class="row">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010072 <div class="offset-sm-3 col-sm-9">
73 <div class="btn-group nowrap mass-actions-admin">
74 <button class="btn btn-sm btn-primary d-block d-sm-inline" id="register-fido2">{{ lang.fido2.set_fido2 }}</button>
75 <button type="button" class="btn btn-sm btn-xs-lg btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010076 <ul class="dropdown-menu">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010077 <li><a class="dropdown-item" href="#" id="register-fido2-touchid"><i class="bi bi-apple"></i> {{ lang.fido2.set_fido2_touchid }}</a></li>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010078 </ul>
79 </div>
80 </div>
81 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010082
83 <div class="row mb-3" id="status-fido2">
84 <div class="col-sm-3 col-5 text-end">{{ lang.fido2.register_status }}:</div>
85 <div class="col-sm-9 col-7">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010086 <div id="fido2-alerts">-</div>
87 </div>
88 <br>
89 </div>
90
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010091 <legend style="cursor:pointer;margin-top:20px" data-bs-target="#admin_api" unselectable="on" data-bs-toggle="collapse">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010092 <i style="font-size:10pt;" class="bi bi-plus-square"></i> API
93 </legend>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010094 <hr />
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010095 <div id="admin_api" class="collapse">
96 <div class="row">
97 <div class="col-lg-12">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010098 <p class="text-muted">{{ lang.admin.api_info|raw }}</p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010099 </div>
100 <div class="col-lg-6">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100101 <div class="card mb-3">
102 <div class="card-header">
103 <h4 class="card-title"><i class="bi bi-file-earmark-arrow-down"></i> {{ lang.admin.api_read_only }}</h4>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100104 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100105 <div class="card-body">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100106 <form class="form-horizontal" autocapitalize="none" autocorrect="off" role="form" method="post">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100107 <div class="row mb-4">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100108 <label class="control-label col-sm-3" for="allow_from_ro">{{ lang.admin.api_allow_from }}:</label>
109 <div class="col-sm-9">
110 <textarea class="form-control textarea-code" rows="7" name="allow_from" id="allow_from_ro" {% if api.ro.skip_ip_check %}disabled{% endif %} required>{{ api.ro.allow_from }}</textarea>
111 </div>
112 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100113 <div class="row mb-2">
114 <div class="offset-sm-3 col-sm-9">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100115 <label>
116 <input type="checkbox" name="skip_ip_check" id="skip_ip_check_ro" {% if api.ro.skip_ip_check %}checked{% endif %}> {{ lang.admin.api_skip_ip_check }}
117 </label>
118 </div>
119 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100120 <div class="row mb-4">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100121 <label class="control-label col-sm-3">{{ lang.admin.api_key }}:</label>
122 <div class="col-sm-9">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100123 <input type="text" class="form-control" value="{{ api.ro.api_key|default('-') }}" readonly />
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100124 </div>
125 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100126 <div class="row mb-2">
127 <div class="offset-sm-3 col-sm-9">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100128 <label>
129 <input type="checkbox" name="active" {% if api.ro.active %}checked{% endif %}> {{ lang.admin.activate_api }}
130 </label>
131 </div>
132 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100133 <div class="row mb-2">
134 <div class="offset-sm-3 col-sm-9">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100135 <div class="btn-group">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100136 <button class="btn btn-sm btn-xs-half d-block d-sm-inline btn-success" name="admin_api[ro]" type="submit" href="#"><i class="bi bi-check-lg"></i> {{ lang.admin.save }}</button>
137 <button class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary admin-ays-dialog" name="admin_api_regen_key[ro]" type="submit" href="#" {% if not api.ro.api_key %}disabled{% endif %}>{{ lang.admin.regen_api_key }}</button>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100138 </div>
139 </div>
140 </div>
141 </form>
142 </div>
143 </div>
144 </div>
145 <div class="col-lg-6">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100146 <div class="card mb-3">
147 <div class="card-header">
148 <h4 class="card-title"><i class="bi bi-file-earmark-diff"></i> {{ lang.admin.api_read_write }}</h4>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100149 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100150 <div class="card-body">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100151 <form class="form-horizontal" autocapitalize="none" autocorrect="off" role="form" method="post">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100152 <div class="row mb-4">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100153 <label class="control-label col-sm-3" for="allow_from_rw">{{ lang.admin.api_allow_from }}:</label>
154 <div class="col-sm-9">
155 <textarea class="form-control textarea-code" rows="7" name="allow_from" id="allow_from_rw" {% if api.rw.skip_ip_check %}disabled{% endif %} required>{{ api.rw.allow_from }}</textarea>
156 </div>
157 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100158 <div class="row mb-2">
159 <div class="offset-sm-3 col-sm-9">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100160 <label>
161 <input type="checkbox" name="skip_ip_check" id="skip_ip_check_rw" {% if api.rw.skip_ip_check %}checked{% endif %}> {{ lang.admin.api_skip_ip_check }}
162 </label>
163 </div>
164 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100165 <div class="row mb-4">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100166 <label class="control-label col-sm-3" for="admin_api_key">{{ lang.admin.api_key }}:</label>
167 <div class="col-sm-9">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100168 <input type="text" class="form-control" value="{{ api.rw.api_key|default('-') }}" readonly />
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100169 </div>
170 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100171 <div class="row mb-2">
172 <div class="offset-sm-3 col-sm-9">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100173 <label>
174 <input type="checkbox" name="active" {% if api.rw.active %}checked{% endif %}> {{ lang.admin.activate_api }}
175 </label>
176 </div>
177 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100178 <div class="row mb-2">
179 <div class="offset-sm-3 col-sm-9">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100180 <div class="btn-group">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100181 <button class="btn btn-sm btn-xs-half d-block d-sm-inline btn-success" name="admin_api[rw]" type="submit" href="#"><i class="bi bi-check-lg"></i> {{ lang.admin.save }}</button>
182 <button class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary admin-ays-dialog" name="admin_api_regen_key[rw]" type="submit" {% if not api.rw.api_key %}disabled{% endif %} href="#">{{ lang.admin.regen_api_key }}</button>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100183 </div>
184 </div>
185 </div>
186 </form>
187 </div>
188 </div>
189 </div>
190 </div>
191 </div>
192 </div>
193 </div>
194
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100195 <div class="card mb-4">
196 <div class="card-header d-flex fs-5">
197 <button class="btn d-md-none flex-grow-1 text-start" data-bs-target="#collapse-tab-config-dadmins" data-bs-toggle="collapse" aria-controls="ollapse-tab-config-dadmins">
198 {{ lang.admin.domain_admins }}
199 </button>
200 <span class="d-none d-md-block">{{ lang.admin.domain_admins }}</span>
201 </div>
202 <div id="collapse-tab-config-dadmins" class="card-body collapse" data-bs-parent="#admin-content">
203 <table id="domainadminstable" class="table table-striped dt-responsive w-100"></table>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100204 <div class="mass-actions-admin">
205 <div class="btn-group">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100206 <a class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary" id="toggle_multi_select_all" data-id="domain_admins" href="#"><i class="bi bi-check-all"></i> {{ lang.mailbox.toggle_all }}</a>
207 <a class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary dropdown-toggle" data-bs-toggle="dropdown" href="#">{{ lang.mailbox.quick_actions }}</a>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100208 <ul class="dropdown-menu">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100209 <li><a class="dropdown-item" data-action="edit_selected" data-id="domain_admins" data-api-url='edit/domain-admin' data-api-attr='{"active":"1"}' href="#">{{ lang.mailbox.activate }}</a></li>
210 <li><a class="dropdown-item" data-action="edit_selected" data-id="domain_admins" data-api-url='edit/domain-admin' data-api-attr='{"active":"0"}' href="#">{{ lang.mailbox.deactivate }}</a></li>
211 <li><hr class="dropdown-divider"></li>
212 <li><a class="dropdown-item" data-action="edit_selected" data-id="domain_admins" data-api-url='edit/domain-admin' data-api-attr='{"disable_tfa":"1"}' href="#">{{ lang.tfa.disable_tfa }}</a></li>
213 <li><hr class="dropdown-divider"></li>
214 <li><a class="dropdown-item" data-action="delete_selected" data-id="domain_admins" data-api-url='delete/domain-admin' href="#">{{ lang.mailbox.remove }}</a></li>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100215 </ul>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100216 <a class="btn btn-sm d-block d-sm-inline btn-success" data-id="add_domain_admin" data-bs-toggle="modal" data-bs-target="#addDomainAdminModal" href="#"><i class="bi bi-person-plus-fill"></i> {{ lang.admin.add_domain_admin }}</a>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100217 </div>
218 </div>
219 </div>
220 </div>
221</div>