1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2026-06-15 02:50:33 +00:00

Merge pull request #7275 from Snafu/fix/admin-mailbox-tfa-missing

Fix force_tfa not available in mailbox template #7216
This commit is contained in:
FreddleSpl0it
2026-06-11 10:03:39 +02:00
committed by GitHub
5 changed files with 35 additions and 1 deletions
+12
View File
@@ -1072,6 +1072,7 @@ paths:
password2: "*" password2: "*"
quota: "3072" quota: "3072"
force_pw_update: "1" force_pw_update: "1"
force_tfa: "1"
tls_enforce_in: "1" tls_enforce_in: "1"
tls_enforce_out: "1" tls_enforce_out: "1"
tags: ["tag1", "tag2"] tags: ["tag1", "tag2"]
@@ -1118,6 +1119,7 @@ paths:
password2: atedismonsin password2: atedismonsin
quota: "3072" quota: "3072"
force_pw_update: "1" force_pw_update: "1"
force_tfa: "1"
tls_enforce_in: "1" tls_enforce_in: "1"
tls_enforce_out: "1" tls_enforce_out: "1"
tags: ["tag1", "tag2"] tags: ["tag1", "tag2"]
@@ -1151,6 +1153,9 @@ paths:
force_pw_update: force_pw_update:
description: forces the user to update its password on first login description: forces the user to update its password on first login
type: boolean type: boolean
force_tfa:
description: force 2FA enrollment at login
type: boolean
tls_enforce_in: tls_enforce_in:
description: force inbound email tls encryption description: force inbound email tls encryption
type: boolean type: boolean
@@ -3414,6 +3419,7 @@ paths:
- mailbox - mailbox
- active: "1" - active: "1"
force_pw_update: "0" force_pw_update: "0"
force_tfa: "0"
name: Full name name: Full name
password: "*" password: "*"
password2: "*" password2: "*"
@@ -3464,6 +3470,7 @@ paths:
attr: attr:
active: "1" active: "1"
force_pw_update: "0" force_pw_update: "0"
force_tfa: "0"
name: Full name name: Full name
authsource: mailcow authsource: mailcow
password: "" password: ""
@@ -3487,6 +3494,9 @@ paths:
force_pw_update: force_pw_update:
description: force user to change password on next login description: force user to change password on next login
type: boolean type: boolean
force_tfa:
description: force 2FA enrollment at login
type: boolean
name: name:
description: Full name of the mailbox user description: Full name of the mailbox user
type: string type: string
@@ -4881,6 +4891,7 @@ paths:
- active: "1" - active: "1"
attributes: attributes:
force_pw_update: "0" force_pw_update: "0"
force_tfa: "0"
mailbox_format: "maildir:" mailbox_format: "maildir:"
quarantine_notification: never quarantine_notification: never
sogo_access: "1" sogo_access: "1"
@@ -5805,6 +5816,7 @@ paths:
- active: "1" - active: "1"
attributes: attributes:
force_pw_update: "0" force_pw_update: "0"
force_tfa: "0"
mailbox_format: "maildir:" mailbox_format: "maildir:"
quarantine_notification: never quarantine_notification: never
sogo_access: "1" sogo_access: "1"
+1
View File
@@ -3827,6 +3827,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
$attr["rl_frame"] = (!empty($_data['rl_frame'])) ? $_data['rl_frame'] : $is_now['rl_frame']; $attr["rl_frame"] = (!empty($_data['rl_frame'])) ? $_data['rl_frame'] : $is_now['rl_frame'];
$attr["rl_value"] = (!empty($_data['rl_value'])) ? $_data['rl_value'] : $is_now['rl_value']; $attr["rl_value"] = (!empty($_data['rl_value'])) ? $_data['rl_value'] : $is_now['rl_value'];
$attr["force_pw_update"] = isset($_data['force_pw_update']) ? intval($_data['force_pw_update']) : $is_now['force_pw_update']; $attr["force_pw_update"] = isset($_data['force_pw_update']) ? intval($_data['force_pw_update']) : $is_now['force_pw_update'];
$attr["force_tfa"] = isset($_data['force_tfa']) ? intval($_data['force_tfa']) : $is_now['force_tfa'];
$attr["sogo_access"] = isset($_data['sogo_access']) ? intval($_data['sogo_access']) : $is_now['sogo_access']; $attr["sogo_access"] = isset($_data['sogo_access']) ? intval($_data['sogo_access']) : $is_now['sogo_access'];
$attr["active"] = isset($_data['active']) ? intval($_data['active']) : $is_now['active']; $attr["active"] = isset($_data['active']) ? intval($_data['active']) : $is_now['active'];
$attr["tls_enforce_in"] = isset($_data['tls_enforce_in']) ? intval($_data['tls_enforce_in']) : $is_now['tls_enforce_in']; $attr["tls_enforce_in"] = isset($_data['tls_enforce_in']) ? intval($_data['tls_enforce_in']) : $is_now['tls_enforce_in'];
+11
View File
@@ -424,6 +424,11 @@ $(document).ready(function() {
} else { } else {
$('#force_pw_update').prop('checked', false); $('#force_pw_update').prop('checked', false);
} }
if (template.force_tfa == 1){
$('#force_tfa').prop('checked', true);
} else {
$('#force_tfa').prop('checked', false);
}
if (template.sogo_access == 1){ if (template.sogo_access == 1){
$('#sogo_access').prop('checked', true); $('#sogo_access').prop('checked', true);
} else { } else {
@@ -1242,6 +1247,7 @@ jQuery(function($){
item.attributes.eas_access = '<i class="text-' + (item.attributes.eas_access == 1 ? 'success' : 'danger') + ' bi bi-' + (item.attributes.eas_access == 1 ? 'check-lg' : 'x-lg') + '"><span class="sorting-value">' + (item.attributes.eas_access == 1 ? '1' : '0') + '</span></i>'; item.attributes.eas_access = '<i class="text-' + (item.attributes.eas_access == 1 ? 'success' : 'danger') + ' bi bi-' + (item.attributes.eas_access == 1 ? 'check-lg' : 'x-lg') + '"><span class="sorting-value">' + (item.attributes.eas_access == 1 ? '1' : '0') + '</span></i>';
item.attributes.dav_access = '<i class="text-' + (item.attributes.dav_access == 1 ? 'success' : 'danger') + ' bi bi-' + (item.attributes.dav_access == 1 ? 'check-lg' : 'x-lg') + '"><span class="sorting-value">' + (item.attributes.dav_access == 1 ? '1' : '0') + '</span></i>'; item.attributes.dav_access = '<i class="text-' + (item.attributes.dav_access == 1 ? 'success' : 'danger') + ' bi bi-' + (item.attributes.dav_access == 1 ? 'check-lg' : 'x-lg') + '"><span class="sorting-value">' + (item.attributes.dav_access == 1 ? '1' : '0') + '</span></i>';
item.attributes.sogo_access = '<i class="text-' + (item.attributes.sogo_access == 1 ? 'success' : 'danger') + ' bi bi-' + (item.attributes.sogo_access == 1 ? 'check-lg' : 'x-lg') + '"><span class="sorting-value">' + (item.attributes.sogo_access == 1 ? '1' : '0') + '</span></i>'; item.attributes.sogo_access = '<i class="text-' + (item.attributes.sogo_access == 1 ? 'success' : 'danger') + ' bi bi-' + (item.attributes.sogo_access == 1 ? 'check-lg' : 'x-lg') + '"><span class="sorting-value">' + (item.attributes.sogo_access == 1 ? '1' : '0') + '</span></i>';
item.attributes.force_tfa = '<i class="text-' + (item.attributes.force_tfa == 1 ? 'success' : 'danger') + ' bi bi-' + (item.attributes.force_tfa == 1 ? 'check-lg' : 'x-lg') + '"><span class="sorting-value">' + (item.attributes.force_tfa == 1 ? '1' : '0') + '</span></i>';
if (item.attributes.quarantine_notification === 'never') { if (item.attributes.quarantine_notification === 'never') {
item.attributes.quarantine_notification = lang.never; item.attributes.quarantine_notification = lang.never;
} else if (item.attributes.quarantine_notification === 'hourly') { } else if (item.attributes.quarantine_notification === 'hourly') {
@@ -1385,6 +1391,11 @@ jQuery(function($){
return 1==data?'<i class="bi bi-check-lg"></i>':'<i class="bi bi-x-lg"></i>'; return 1==data?'<i class="bi bi-check-lg"></i>':'<i class="bi bi-x-lg"></i>';
} }
}, },
{
title: lang.force_tfa,
data: 'attributes.force_tfa',
defaultContent: ''
},
{ {
title: lang_edit.ratelimit, title: lang_edit.ratelimit,
data: 'attributes.ratelimit', data: 'attributes.ratelimit',
+1
View File
@@ -929,6 +929,7 @@
"filters": "Filters", "filters": "Filters",
"fname": "Full name", "fname": "Full name",
"force_pw_update": "Force password update at next login", "force_pw_update": "Force password update at next login",
"force_tfa": "TFA",
"gal": "Global Address List", "gal": "Global Address List",
"goto_ham": "Learn as <b>ham</b>", "goto_ham": "Learn as <b>ham</b>",
"goto_spam": "Learn as <b>spam</b>", "goto_spam": "Learn as <b>spam</b>",
@@ -8,6 +8,7 @@
<input type="hidden" value="default" name="sender_acl"> <input type="hidden" value="default" name="sender_acl">
<input type="hidden" value="0" name="force_pw_update"> <input type="hidden" value="0" name="force_pw_update">
<input type="hidden" value="0" name="force_tfa">
<input type="hidden" value="0" name="sogo_access"> <input type="hidden" value="0" name="sogo_access">
<input type="hidden" value="0" name="protocol_access"> <input type="hidden" value="0" name="protocol_access">
@@ -165,6 +166,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="offset-sm-2 col-sm-10">
<div class="form-check">
<label><input type="checkbox" class="form-check-input" value="1" name="force_tfa" id="force_tfa"{% if template.attributes.force_tfa == '1' %} checked{% endif %}> {{ lang.tfa.force_tfa }}</label>
<small class="text-muted">{{ lang.tfa.force_tfa_info }}</small>
</div>
</div>
</div>
{% if not skip_sogo %} {% if not skip_sogo %}
<div class="row"> <div class="row">
<div class="offset-sm-2 col-sm-10"> <div class="offset-sm-2 col-sm-10">