From d7ff8d9d175dd610086cc763985572823a92e401 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 25 Nov 2020 15:21:46 +0100 Subject: [PATCH] Separate form element for the login username --- .../templates/__multifactorAuthenticationLoginAs.tpl | 4 ++++ com.woltlab.wcf/templates/multifactorAuthentication.tpl | 4 ---- .../acp/templates/__multifactorAuthenticationLoginAs.tpl | 4 ++++ .../files/acp/templates/multifactorAuthentication.tpl | 4 ---- .../lib/form/MultifactorAuthenticationForm.class.php | 9 ++++++++- 5 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 com.woltlab.wcf/templates/__multifactorAuthenticationLoginAs.tpl create mode 100644 wcfsetup/install/files/acp/templates/__multifactorAuthenticationLoginAs.tpl diff --git a/com.woltlab.wcf/templates/__multifactorAuthenticationLoginAs.tpl b/com.woltlab.wcf/templates/__multifactorAuthenticationLoginAs.tpl new file mode 100644 index 0000000000..244ce13cfc --- /dev/null +++ b/com.woltlab.wcf/templates/__multifactorAuthenticationLoginAs.tpl @@ -0,0 +1,4 @@ +
+
{lang}wcf.user.security.multifactor.authentication.loginAs{/lang}
+
{$user->username}
+
diff --git a/com.woltlab.wcf/templates/multifactorAuthentication.tpl b/com.woltlab.wcf/templates/multifactorAuthentication.tpl index 07eb5827cc..3adec5facf 100644 --- a/com.woltlab.wcf/templates/multifactorAuthentication.tpl +++ b/com.woltlab.wcf/templates/multifactorAuthentication.tpl @@ -17,10 +17,6 @@
-
-
{lang}wcf.user.security.multifactor.authentication.loginAs{/lang}
-
{$user->username}
-
{@$form->getHtml()}
diff --git a/wcfsetup/install/files/acp/templates/__multifactorAuthenticationLoginAs.tpl b/wcfsetup/install/files/acp/templates/__multifactorAuthenticationLoginAs.tpl new file mode 100644 index 0000000000..244ce13cfc --- /dev/null +++ b/wcfsetup/install/files/acp/templates/__multifactorAuthenticationLoginAs.tpl @@ -0,0 +1,4 @@ +
+
{lang}wcf.user.security.multifactor.authentication.loginAs{/lang}
+
{$user->username}
+
diff --git a/wcfsetup/install/files/acp/templates/multifactorAuthentication.tpl b/wcfsetup/install/files/acp/templates/multifactorAuthentication.tpl index cd9c205db6..83c20f9a92 100644 --- a/wcfsetup/install/files/acp/templates/multifactorAuthentication.tpl +++ b/wcfsetup/install/files/acp/templates/multifactorAuthentication.tpl @@ -22,10 +22,6 @@
-
-
{lang}wcf.user.security.multifactor.authentication.loginAs{/lang}
-
{$user->username}
-
{@$form->getHtml()}
diff --git a/wcfsetup/install/files/lib/form/MultifactorAuthenticationForm.class.php b/wcfsetup/install/files/lib/form/MultifactorAuthenticationForm.class.php index 3dc227958a..ceea1c9000 100644 --- a/wcfsetup/install/files/lib/form/MultifactorAuthenticationForm.class.php +++ b/wcfsetup/install/files/lib/form/MultifactorAuthenticationForm.class.php @@ -7,6 +7,7 @@ use wcf\system\application\ApplicationHandler; use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\exception\IllegalLinkException; use wcf\system\exception\PermissionDeniedException; +use wcf\system\form\builder\TemplateFormNode; use wcf\system\request\LinkHandler; use wcf\system\user\multifactor\IMultifactorMethod; use wcf\system\user\multifactor\Setup; @@ -111,6 +112,12 @@ class MultifactorAuthenticationForm extends AbstractFormBuilderForm { protected function createForm() { parent::createForm(); + $this->form->appendChild( + TemplateFormNode::create('loginAs') + ->application('wcf') + ->templateName('__multifactorAuthenticationLoginAs') + ); + $this->processor->createAuthenticationForm($this->form, $this->setup); } @@ -121,7 +128,7 @@ class MultifactorAuthenticationForm extends AbstractFormBuilderForm { $setup = $this->setup->lock(); - $this->returnData = $this->processor->processAuthenticationForm($this->form, $setup); + $this->processor->processAuthenticationForm($this->form, $setup); WCF::getDB()->commitTransaction(); -- 2.20.1