Show configured MFA status and add CLI reset commands (#1196)

The administrator list shows a translated Yes/No MFA column immediately after Active. 
Domains display an MFA badge only when at least one mailbox has a configured secret. 

Add resetmfa task for the postfixadmin-cli command. ( postfixadmin-cli admin resetmfa <address> and
postfixadmin-cli mailbox resetmfa <address> )

thanks @TrapoSAMA
This commit is contained in:
Rodrigo Cortés Cano authored and GitHub committed 2026-11-18 13:22:21 +00:00
1 parent f3ffeae493
commit 1eaaecfcbc
53 files changed
+343 -4

No files matched your search

+4
View File
@@ -4,6 +4,8 @@
class AdminHandler extends PFAHandler
{
public array $taskNames = ['Help', 'Add', 'Update', 'Delete', 'View', 'Scheme', 'Resetmfa'];
protected string $db_table = 'admin';
protected string $id_field = 'username';
@@ -84,6 +86,8 @@ class AdminHandler extends PFAHandler
' ) AS __domain on username = __domain_username'),
'active' => self::pacol(1, 1, 1, 'bool', 'active' , '' , 1),
'mfa' => self::pacol(0, 0, 1, 'vnum', 'mfa', '', 0, [], 0, 1,
"CASE WHEN totp_secret IS NOT NULL AND totp_secret <> '' THEN 1 ELSE 0 END AS mfa"),
'phone' => self::pacol(1, $reset_by_sms, 0, 'text', 'pCreate_mailbox_phone', 'pCreate_mailbox_phone_desc', ''),
'email_other' => self::pacol(1, $passwordReset, 0, 'mail', 'pCreate_mailbox_email', 'pCreate_mailbox_email_desc', ''),
'token' => self::pacol(1, 0, 0, 'text', '' , ''),