From 276df3933394c3afd49fa6b640de4a954d6060d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 5 Nov 2020 11:03:31 +0100 Subject: [PATCH] Implement getStatusText() for the `backup` multifactor method --- com.woltlab.wcf/templates/accountSecurity.tpl | 4 +++- .../multifactor/BackupMultifactorMethod.class.php | 14 ++++++++++---- .../user/multifactor/IMultifactorMethod.class.php | 5 ++--- .../multifactor/TotpMultifactorMethod.class.php | 3 +-- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/com.woltlab.wcf/templates/accountSecurity.tpl b/com.woltlab.wcf/templates/accountSecurity.tpl index 9684b731ae..68eee0901e 100644 --- a/com.woltlab.wcf/templates/accountSecurity.tpl +++ b/com.woltlab.wcf/templates/accountSecurity.tpl @@ -24,7 +24,9 @@ {/if} - {$method->getProcessor()->getStatusText($__wcf->user)} + {if $enabledMultifactorMethods[$method->objectTypeID]|isset} + {$method->getProcessor()->getStatusText($enabledMultifactorMethods[$method->objectTypeID])} + {/if}
diff --git a/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php b/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php index ac3fd59627..a783a9b9b1 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php @@ -1,6 +1,5 @@ prepareStatement($sql); + $statement->execute([$setupId]); + + // TODO: Language item + return $statement->fetchSingleColumn()." codes remaining"; } /** diff --git a/wcfsetup/install/files/lib/system/user/multifactor/IMultifactorMethod.class.php b/wcfsetup/install/files/lib/system/user/multifactor/IMultifactorMethod.class.php index 22abe11556..b68bebb573 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/IMultifactorMethod.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/IMultifactorMethod.class.php @@ -1,6 +1,5 @@