Separate form element for the login username
authorAlexander Ebert <ebert@woltlab.com>
Wed, 25 Nov 2020 14:21:46 +0000 (15:21 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 25 Nov 2020 14:21:46 +0000 (15:21 +0100)
com.woltlab.wcf/templates/__multifactorAuthenticationLoginAs.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/multifactorAuthentication.tpl
wcfsetup/install/files/acp/templates/__multifactorAuthenticationLoginAs.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/multifactorAuthentication.tpl
wcfsetup/install/files/lib/form/MultifactorAuthenticationForm.class.php

diff --git a/com.woltlab.wcf/templates/__multifactorAuthenticationLoginAs.tpl b/com.woltlab.wcf/templates/__multifactorAuthenticationLoginAs.tpl
new file mode 100644 (file)
index 0000000..244ce13
--- /dev/null
@@ -0,0 +1,4 @@
+<dl>
+       <dt>{lang}wcf.user.security.multifactor.authentication.loginAs{/lang}</dt>
+       <dd>{$user->username}</dd>
+</dl>
index 07eb5827ccd2d4d7fb09310dfaa2a639fc019afe..3adec5facf7e0acf50142f1b7d1001c64e52ca76 100644 (file)
 
        <div class="tabMenuContent">
                <div class="section">
-                       <dl>
-                               <dt>{lang}wcf.user.security.multifactor.authentication.loginAs{/lang}</dt>
-                               <dd>{$user->username}</dd>
-                       </dl>
                        {@$form->getHtml()}
                </div>
        </div>
diff --git a/wcfsetup/install/files/acp/templates/__multifactorAuthenticationLoginAs.tpl b/wcfsetup/install/files/acp/templates/__multifactorAuthenticationLoginAs.tpl
new file mode 100644 (file)
index 0000000..244ce13
--- /dev/null
@@ -0,0 +1,4 @@
+<dl>
+       <dt>{lang}wcf.user.security.multifactor.authentication.loginAs{/lang}</dt>
+       <dd>{$user->username}</dd>
+</dl>
index cd9c205db6b327471386dba7aaec5fef768449fc..83c20f9a92cc7fc2eedc4137c2036ae2dbd8da12 100644 (file)
 
        <div class="tabMenuContent">
                <div class="section">
-                       <dl>
-                               <dt>{lang}wcf.user.security.multifactor.authentication.loginAs{/lang}</dt>
-                               <dd>{$user->username}</dd>
-                       </dl>
                        {@$form->getHtml()}
                </div>
        </div>
index 3dc227958ad273421aaa4a09cbfbf0e3f9ad9028..ceea1c90004d61147e6c3a3280466807371a5615 100644 (file)
@@ -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();