From 782614441b463ab147292d09dc682ed145a84769 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 9 Dec 2020 10:45:16 +0100 Subject: [PATCH] Make use of ->markRequiredFields(false) for single-field authentication forms --- wcfsetup/install/files/lib/form/ReauthenticationForm.class.php | 1 + .../system/user/multifactor/BackupMultifactorMethod.class.php | 2 ++ .../system/user/multifactor/EmailMultifactorMethod.class.php | 2 ++ .../lib/system/user/multifactor/TotpMultifactorMethod.class.php | 2 ++ 4 files changed, 7 insertions(+) diff --git a/wcfsetup/install/files/lib/form/ReauthenticationForm.class.php b/wcfsetup/install/files/lib/form/ReauthenticationForm.class.php index ee9c1f301e..7667be542e 100644 --- a/wcfsetup/install/files/lib/form/ReauthenticationForm.class.php +++ b/wcfsetup/install/files/lib/form/ReauthenticationForm.class.php @@ -55,6 +55,7 @@ class ReauthenticationForm extends AbstractFormBuilderForm { protected function createForm() { parent::createForm(); + $this->form->markRequiredFields(false); $this->form->appendChildren([ TemplateFormNode::create('loginAs') ->templateName('__reauthenticationLoginAs'), 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 7f5a6b1a8b..8d63feb11f 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php @@ -240,6 +240,8 @@ class BackupMultifactorMethod implements IMultifactorMethod { * @inheritDoc */ public function createAuthenticationForm(IFormDocument $form, Setup $setup): void { + $form->markRequiredFields(false); + $sql = "SELECT * FROM wcf".WCF_N."_user_multifactor_backup WHERE setupID = ?"; diff --git a/wcfsetup/install/files/lib/system/user/multifactor/EmailMultifactorMethod.class.php b/wcfsetup/install/files/lib/system/user/multifactor/EmailMultifactorMethod.class.php index 4ca96e10a1..740ae8144c 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/EmailMultifactorMethod.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/EmailMultifactorMethod.class.php @@ -132,6 +132,8 @@ class EmailMultifactorMethod implements IMultifactorMethod { * @inheritDoc */ public function createAuthenticationForm(IFormDocument $form, Setup $setup): void { + $form->markRequiredFields(false); + $sql = "SELECT code, createTime FROM wcf".WCF_N."_user_multifactor_email WHERE setupID = ? diff --git a/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php b/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php index 6edcddd6f0..6a7e1ce03d 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php @@ -243,6 +243,8 @@ class TotpMultifactorMethod implements IMultifactorMethod { * @inheritDoc */ public function createAuthenticationForm(IFormDocument $form, Setup $setup): void { + $form->markRequiredFields(false); + $sql = "SELECT * FROM wcf".WCF_N."_user_multifactor_totp WHERE setupID = ? -- 2.20.1