Use multifactor prefix for formbuilder templates related to MFA
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 18 Nov 2020 14:22:45 +0000 (15:22 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 18 Nov 2020 14:22:45 +0000 (15:22 +0100)
24 files changed:
com.woltlab.wcf/templates/__backupCodeField.tpl [deleted file]
com.woltlab.wcf/templates/__emailCodeField.tpl [deleted file]
com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/__multifactorEmailCodeField.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/__multifactorTotpDeviceNoDeleteButton.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/__multifactorTotpDeviceNode.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/__multifactorTotpDevicesContainer.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/__multifactorTotpNewDeviceContainer.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/__multifactorTotpSecretField.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/__totpCodeField.tpl [deleted file]
com.woltlab.wcf/templates/__totpDeviceNoDeleteButton.tpl [deleted file]
com.woltlab.wcf/templates/__totpDeviceNode.tpl [deleted file]
com.woltlab.wcf/templates/__totpDevicesContainer.tpl [deleted file]
com.woltlab.wcf/templates/__totpNewDeviceContainer.tpl [deleted file]
com.woltlab.wcf/templates/__totpSecretField.tpl [deleted file]
wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php
wcfsetup/install/files/lib/system/user/multifactor/backup/CodeFormField.class.php
wcfsetup/install/files/lib/system/user/multifactor/email/CodeFormField.class.php
wcfsetup/install/files/lib/system/user/multifactor/totp/CodeFormField.class.php
wcfsetup/install/files/lib/system/user/multifactor/totp/DeviceNode.class.php
wcfsetup/install/files/lib/system/user/multifactor/totp/DevicesContainer.class.php
wcfsetup/install/files/lib/system/user/multifactor/totp/NewDeviceContainer.class.php
wcfsetup/install/files/lib/system/user/multifactor/totp/SecretFormField.class.php

diff --git a/com.woltlab.wcf/templates/__backupCodeField.tpl b/com.woltlab.wcf/templates/__backupCodeField.tpl
deleted file mode 100644 (file)
index d762561..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<input type="text" {*
-       *}id="{@$field->getPrefixedId()}" {*
-       *}name="{@$field->getPrefixedId()}" {*
-       *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
-       *}class="multifactorBackupCode" {*
-       *}autocomplete="off" {*
-       *}pattern="[0-9\s]*" {*
-       *}inputmode="numeric"{*
-       *}{if $field->getChunks() && $field->getChunkLength()} size="{$field->getChunks() - 1 + $field->getChunks() * $field->getChunkLength()}"{/if}{*
-       *}{if $field->isAutofocused()} autofocus{/if}{*
-       *}{if $field->isRequired()} required{/if}{*
-       *}{if $field->isImmutable()} disabled{/if}{*
-       *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{*
-       *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
-       *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
-       *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
-*}>
diff --git a/com.woltlab.wcf/templates/__emailCodeField.tpl b/com.woltlab.wcf/templates/__emailCodeField.tpl
deleted file mode 100644 (file)
index 331481b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<input type="text" {*
-       *}id="{@$field->getPrefixedId()}" {*
-       *}name="{@$field->getPrefixedId()}" {*
-       *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
-       *}class="multifactorEmailCode" {*
-       *}autocomplete="off" {*
-       *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
-       *}pattern="[0-9]*" {*
-       *}inputmode="numeric"{*
-       *}{if $field->isAutofocused()} autofocus{/if}{*
-       *}{if $field->isRequired()} required{/if}{*
-       *}{if $field->isImmutable()} disabled{/if}{*
-       *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{*
-       *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
-       *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
-       *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
-*}>
diff --git a/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl b/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl
new file mode 100644 (file)
index 0000000..d762561
--- /dev/null
@@ -0,0 +1,17 @@
+<input type="text" {*
+       *}id="{@$field->getPrefixedId()}" {*
+       *}name="{@$field->getPrefixedId()}" {*
+       *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
+       *}class="multifactorBackupCode" {*
+       *}autocomplete="off" {*
+       *}pattern="[0-9\s]*" {*
+       *}inputmode="numeric"{*
+       *}{if $field->getChunks() && $field->getChunkLength()} size="{$field->getChunks() - 1 + $field->getChunks() * $field->getChunkLength()}"{/if}{*
+       *}{if $field->isAutofocused()} autofocus{/if}{*
+       *}{if $field->isRequired()} required{/if}{*
+       *}{if $field->isImmutable()} disabled{/if}{*
+       *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{*
+       *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
+       *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
+       *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
+*}>
diff --git a/com.woltlab.wcf/templates/__multifactorEmailCodeField.tpl b/com.woltlab.wcf/templates/__multifactorEmailCodeField.tpl
new file mode 100644 (file)
index 0000000..331481b
--- /dev/null
@@ -0,0 +1,17 @@
+<input type="text" {*
+       *}id="{@$field->getPrefixedId()}" {*
+       *}name="{@$field->getPrefixedId()}" {*
+       *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
+       *}class="multifactorEmailCode" {*
+       *}autocomplete="off" {*
+       *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
+       *}pattern="[0-9]*" {*
+       *}inputmode="numeric"{*
+       *}{if $field->isAutofocused()} autofocus{/if}{*
+       *}{if $field->isRequired()} required{/if}{*
+       *}{if $field->isImmutable()} disabled{/if}{*
+       *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{*
+       *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
+       *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
+       *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
+*}>
diff --git a/com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl b/com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl
new file mode 100644 (file)
index 0000000..9b46101
--- /dev/null
@@ -0,0 +1,17 @@
+<input type="text" {*
+       *}id="{@$field->getPrefixedId()}" {*
+       *}name="{@$field->getPrefixedId()}" {*
+       *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
+       *}class="multifactorTotpCode" {*
+       *}autocomplete="off" {*
+       *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
+       *}pattern="[0-9]*" {*
+       *}inputmode="numeric"{*
+       *}{if $field->isAutofocused()} autofocus{/if}{*
+       *}{if $field->isRequired()} required{/if}{*
+       *}{if $field->isImmutable()} disabled{/if}{*
+       *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{*
+       *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
+       *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
+       *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
+*}>
diff --git a/com.woltlab.wcf/templates/__multifactorTotpDeviceNoDeleteButton.tpl b/com.woltlab.wcf/templates/__multifactorTotpDeviceNoDeleteButton.tpl
new file mode 100644 (file)
index 0000000..1d4047c
--- /dev/null
@@ -0,0 +1,4 @@
+<button type="button" id="{@$button->getPrefixedId()}" class="jsStaticDialog" data-dialog-id="{@$button->getPrefixedId()}DeletionInfo">{$button->getLabel()}</button>
+<div style="display: none;" id="{@$button->getPrefixedId()}DeletionInfo" data-title="{lang}wcf.user.security.multifactor.totp.lastDevice.title{/lang}">
+       {lang deviceName=$device[deviceName]}wcf.user.security.multifactor.totp.lastDevice{/lang}
+</div>
diff --git a/com.woltlab.wcf/templates/__multifactorTotpDeviceNode.tpl b/com.woltlab.wcf/templates/__multifactorTotpDeviceNode.tpl
new file mode 100644 (file)
index 0000000..a96b0f3
--- /dev/null
@@ -0,0 +1,13 @@
+
+<tr>
+       <td class="columnText">{$device[deviceName]}</td>
+       <td class="columnDate">{$device[createTime]|plainTime}</td>
+       <td class="columnDate">{if $device[useTime]}{$device[useTime]|plainTime}{else}&ndash;{/if}</td>
+       <td class="columnText">
+               {foreach from=$container item='child'}
+                       {if $child->isAvailable()}
+                               {@$child->getHtml()}
+                       {/if}
+               {/foreach}
+       </td>
+</tr>
diff --git a/com.woltlab.wcf/templates/__multifactorTotpDevicesContainer.tpl b/com.woltlab.wcf/templates/__multifactorTotpDevicesContainer.tpl
new file mode 100644 (file)
index 0000000..a7238b2
--- /dev/null
@@ -0,0 +1,43 @@
+<section id="{@$container->getPrefixedId()}Container"{*
+       *}{if !$container->getClasses()|empty} class="{implode from=$container->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
+       *}{foreach from=$container->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
+       *}{if !$container->checkDependencies()} style="display: none;"{/if}{*
+*}>
+       {if $container->getLabel() !== null}
+               {if $container->getDescription() !== null}
+                       <header class="sectionHeader">
+                               <h2 class="sectionTitle">{@$container->getLabel()}{if $container->markAsRequired()} <span class="formFieldRequired">*</span>{/if}</h2>
+                               <p class="sectionDescription">{@$container->getDescription()}</p>
+                       </header>
+               {else}
+                       <h2 class="sectionTitle">{@$container->getLabel()}{if $container->markAsRequired()} <span class="formFieldRequired">*</span>{/if}</h2>
+               {/if}
+       {/if}
+       
+       <table class="table table-responsive">
+               <thead>
+                       <tr>
+                               <th class="columnText">{lang}wcf.user.security.multifactor.totp.deviceName{/lang}</th>
+                               <th class="columnText">{lang}wcf.user.security.multifactor.totp.createTime{/lang}</th>
+                               <th class="columnText">{lang}wcf.user.security.multifactor.totp.useTime{/lang}</th>
+                               <th></th>
+                       </tr>
+               </thead>
+               
+               <tbody>
+                       {foreach from=$container item='child'}
+                               {if $child->isAvailable()}
+                                       {@$child->getHtml()}
+                               {/if}
+                       {/foreach}
+               </tbody>
+       </table>
+</section>
+
+{include file='__formContainerDependencies'}
+
+<script data-relocate="true">
+       require(['WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Default'], function(DefaultContainerDependency) {
+               new DefaultContainerDependency('{@$container->getPrefixedId()}Container');
+       });
+</script>
diff --git a/com.woltlab.wcf/templates/__multifactorTotpNewDeviceContainer.tpl b/com.woltlab.wcf/templates/__multifactorTotpNewDeviceContainer.tpl
new file mode 100644 (file)
index 0000000..19b8887
--- /dev/null
@@ -0,0 +1,46 @@
+<section id="{@$container->getPrefixedId()}Container"{*
+       *}{if !$container->getClasses()|empty} class="{implode from=$container->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
+       *}{foreach from=$container->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
+       *}{if !$container->checkDependencies()} style="display: none;"{/if}{*
+*}>
+       {if $container->getLabel() !== null}
+               {if $container->getDescription() !== null}
+                       <header class="sectionHeader">
+                               <h2 class="sectionTitle">{@$container->getLabel()}{if $container->markAsRequired()} <span class="formFieldRequired">*</span>{/if}</h2>
+                               <p class="sectionDescription">{@$container->getDescription()}</p>
+                       </header>
+               {else}
+                       <h2 class="sectionTitle">{@$container->getLabel()}{if $container->markAsRequired()} <span class="formFieldRequired">*</span>{/if}</h2>
+               {/if}
+       {/if}
+       
+       {lang}wcf.user.security.multifactor.totp.newDevice.description{/lang}
+       
+       <div class="multifactorTotpNewDevice">
+               {if $container->getNodeById('secret')->isAvailable()}
+                       {@$container->getNodeById('secret')->getFieldHtml()}
+               {/if}
+               
+               <div class="multifactorTotpNewDeviceFields">
+                       {foreach from=$container item='child'}
+                               {if $child->getId() !== 'secret' && $child->getId() !== 'submitButton' && $child->isAvailable()}
+                                       {@$child->getHtml()}
+                               {/if}
+                       {/foreach}
+                       
+                       {if $container->getNodeById('submitButton')->isAvailable()}
+                               <div class="formSubmit">
+                                       {@$container->getNodeById('submitButton')->getHtml()}
+                               </div>
+                       {/if}
+               </div>
+       </div>
+</section>
+
+{include file='__formContainerDependencies'}
+
+<script data-relocate="true">
+       require(['WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Default'], function(DefaultContainerDependency) {
+               new DefaultContainerDependency('{@$container->getPrefixedId()}Container');
+       });
+</script>
diff --git a/com.woltlab.wcf/templates/__multifactorTotpSecretField.tpl b/com.woltlab.wcf/templates/__multifactorTotpSecretField.tpl
new file mode 100644 (file)
index 0000000..fc32f52
--- /dev/null
@@ -0,0 +1,15 @@
+<div class="totpSecretContainer">
+       <input type="hidden" name="{@$field->getPrefixedId()}" value="{$field->getSignedValue()}">
+       <canvas></canvas><br>
+       <kbd {*
+       *}class="totpSecret" {*
+       *}data-issuer="{PAGE_TITLE}" {*
+       *}data-accountname="{$__wcf->user->username}"{*
+       *}>{$field->getEncodedValue()}</kbd>
+       
+       <script>
+       (function (script) {
+               require(['WoltLabSuite/Core/Ui/User/Multifactor/Totp/Qr'], (Qr) => Qr.render(script.closest(".totpSecretContainer")));
+       })(document.currentScript);
+       </script>
+</div>
diff --git a/com.woltlab.wcf/templates/__totpCodeField.tpl b/com.woltlab.wcf/templates/__totpCodeField.tpl
deleted file mode 100644 (file)
index 9b46101..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<input type="text" {*
-       *}id="{@$field->getPrefixedId()}" {*
-       *}name="{@$field->getPrefixedId()}" {*
-       *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
-       *}class="multifactorTotpCode" {*
-       *}autocomplete="off" {*
-       *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
-       *}pattern="[0-9]*" {*
-       *}inputmode="numeric"{*
-       *}{if $field->isAutofocused()} autofocus{/if}{*
-       *}{if $field->isRequired()} required{/if}{*
-       *}{if $field->isImmutable()} disabled{/if}{*
-       *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{*
-       *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
-       *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
-       *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
-*}>
diff --git a/com.woltlab.wcf/templates/__totpDeviceNoDeleteButton.tpl b/com.woltlab.wcf/templates/__totpDeviceNoDeleteButton.tpl
deleted file mode 100644 (file)
index 1d4047c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<button type="button" id="{@$button->getPrefixedId()}" class="jsStaticDialog" data-dialog-id="{@$button->getPrefixedId()}DeletionInfo">{$button->getLabel()}</button>
-<div style="display: none;" id="{@$button->getPrefixedId()}DeletionInfo" data-title="{lang}wcf.user.security.multifactor.totp.lastDevice.title{/lang}">
-       {lang deviceName=$device[deviceName]}wcf.user.security.multifactor.totp.lastDevice{/lang}
-</div>
diff --git a/com.woltlab.wcf/templates/__totpDeviceNode.tpl b/com.woltlab.wcf/templates/__totpDeviceNode.tpl
deleted file mode 100644 (file)
index a96b0f3..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-<tr>
-       <td class="columnText">{$device[deviceName]}</td>
-       <td class="columnDate">{$device[createTime]|plainTime}</td>
-       <td class="columnDate">{if $device[useTime]}{$device[useTime]|plainTime}{else}&ndash;{/if}</td>
-       <td class="columnText">
-               {foreach from=$container item='child'}
-                       {if $child->isAvailable()}
-                               {@$child->getHtml()}
-                       {/if}
-               {/foreach}
-       </td>
-</tr>
diff --git a/com.woltlab.wcf/templates/__totpDevicesContainer.tpl b/com.woltlab.wcf/templates/__totpDevicesContainer.tpl
deleted file mode 100644 (file)
index a7238b2..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<section id="{@$container->getPrefixedId()}Container"{*
-       *}{if !$container->getClasses()|empty} class="{implode from=$container->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
-       *}{foreach from=$container->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
-       *}{if !$container->checkDependencies()} style="display: none;"{/if}{*
-*}>
-       {if $container->getLabel() !== null}
-               {if $container->getDescription() !== null}
-                       <header class="sectionHeader">
-                               <h2 class="sectionTitle">{@$container->getLabel()}{if $container->markAsRequired()} <span class="formFieldRequired">*</span>{/if}</h2>
-                               <p class="sectionDescription">{@$container->getDescription()}</p>
-                       </header>
-               {else}
-                       <h2 class="sectionTitle">{@$container->getLabel()}{if $container->markAsRequired()} <span class="formFieldRequired">*</span>{/if}</h2>
-               {/if}
-       {/if}
-       
-       <table class="table table-responsive">
-               <thead>
-                       <tr>
-                               <th class="columnText">{lang}wcf.user.security.multifactor.totp.deviceName{/lang}</th>
-                               <th class="columnText">{lang}wcf.user.security.multifactor.totp.createTime{/lang}</th>
-                               <th class="columnText">{lang}wcf.user.security.multifactor.totp.useTime{/lang}</th>
-                               <th></th>
-                       </tr>
-               </thead>
-               
-               <tbody>
-                       {foreach from=$container item='child'}
-                               {if $child->isAvailable()}
-                                       {@$child->getHtml()}
-                               {/if}
-                       {/foreach}
-               </tbody>
-       </table>
-</section>
-
-{include file='__formContainerDependencies'}
-
-<script data-relocate="true">
-       require(['WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Default'], function(DefaultContainerDependency) {
-               new DefaultContainerDependency('{@$container->getPrefixedId()}Container');
-       });
-</script>
diff --git a/com.woltlab.wcf/templates/__totpNewDeviceContainer.tpl b/com.woltlab.wcf/templates/__totpNewDeviceContainer.tpl
deleted file mode 100644 (file)
index 19b8887..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<section id="{@$container->getPrefixedId()}Container"{*
-       *}{if !$container->getClasses()|empty} class="{implode from=$container->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
-       *}{foreach from=$container->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
-       *}{if !$container->checkDependencies()} style="display: none;"{/if}{*
-*}>
-       {if $container->getLabel() !== null}
-               {if $container->getDescription() !== null}
-                       <header class="sectionHeader">
-                               <h2 class="sectionTitle">{@$container->getLabel()}{if $container->markAsRequired()} <span class="formFieldRequired">*</span>{/if}</h2>
-                               <p class="sectionDescription">{@$container->getDescription()}</p>
-                       </header>
-               {else}
-                       <h2 class="sectionTitle">{@$container->getLabel()}{if $container->markAsRequired()} <span class="formFieldRequired">*</span>{/if}</h2>
-               {/if}
-       {/if}
-       
-       {lang}wcf.user.security.multifactor.totp.newDevice.description{/lang}
-       
-       <div class="multifactorTotpNewDevice">
-               {if $container->getNodeById('secret')->isAvailable()}
-                       {@$container->getNodeById('secret')->getFieldHtml()}
-               {/if}
-               
-               <div class="multifactorTotpNewDeviceFields">
-                       {foreach from=$container item='child'}
-                               {if $child->getId() !== 'secret' && $child->getId() !== 'submitButton' && $child->isAvailable()}
-                                       {@$child->getHtml()}
-                               {/if}
-                       {/foreach}
-                       
-                       {if $container->getNodeById('submitButton')->isAvailable()}
-                               <div class="formSubmit">
-                                       {@$container->getNodeById('submitButton')->getHtml()}
-                               </div>
-                       {/if}
-               </div>
-       </div>
-</section>
-
-{include file='__formContainerDependencies'}
-
-<script data-relocate="true">
-       require(['WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Default'], function(DefaultContainerDependency) {
-               new DefaultContainerDependency('{@$container->getPrefixedId()}Container');
-       });
-</script>
diff --git a/com.woltlab.wcf/templates/__totpSecretField.tpl b/com.woltlab.wcf/templates/__totpSecretField.tpl
deleted file mode 100644 (file)
index fc32f52..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="totpSecretContainer">
-       <input type="hidden" name="{@$field->getPrefixedId()}" value="{$field->getSignedValue()}">
-       <canvas></canvas><br>
-       <kbd {*
-       *}class="totpSecret" {*
-       *}data-issuer="{PAGE_TITLE}" {*
-       *}data-accountname="{$__wcf->user->username}"{*
-       *}>{$field->getEncodedValue()}</kbd>
-       
-       <script>
-       (function (script) {
-               require(['WoltLabSuite/Core/Ui/User/Multifactor/Totp/Qr'], (Qr) => Qr.render(script.closest(".totpSecretContainer")));
-       })(document.currentScript);
-       </script>
-</div>
index 1344fd257a58c28f0dca85c8ac86f36e1cc5c22a..6edcddd6f0ba3beeaaab5dd0ec2e872f6556cb88 100644 (file)
@@ -132,7 +132,7 @@ class TotpMultifactorMethod implements IMultifactorMethod {
                                }
                                else {
                                        $button = new class extends FormButton {
-                                               protected $templateName = '__totpDeviceNoDeleteButton';
+                                               protected $templateName = '__multifactorTotpDeviceNoDeleteButton';
                                        };
                                        $button->id('no-delete-'.$row['deviceID'])
                                                ->label('wcf.global.button.delete');
index 51b09aca7139bfd8a46fde2ab75ff4eb74d533bb..62617bf9fa0f70799ac426404f6684924f5d1ed3 100644 (file)
@@ -30,7 +30,7 @@ class CodeFormField extends TextFormField {
        /**
         * @inheritDoc
         */
-       protected $templateName = '__backupCodeField';
+       protected $templateName = '__multifactorBackupCodeField';
        
        public function __construct() {
                $this->chunks(BackupMultifactorMethod::CHUNKS);
index 3e1b384b42a69e17aae5f9ad2398ae45054ec3e8..0e288b06b507714d28342470dcb99ac394cde380 100644 (file)
@@ -20,7 +20,7 @@ class CodeFormField extends TextFormField {
        /**
         * @inheritDoc
         */
-       protected $templateName = '__emailCodeField';
+       protected $templateName = '__multifactorEmailCodeField';
        
        public function __construct() {
                $this->minimumLength(EmailMultifactorMethod::LENGTH);
index ddc9528ca58435884828ff187a50ca03583f13d8..35aed91541b0000d3ea68da67e2b6324420232d2 100644 (file)
@@ -19,7 +19,7 @@ class CodeFormField extends TextFormField {
        /**
         * @inheritDoc
         */
-       protected $templateName = '__totpCodeField';
+       protected $templateName = '__multifactorTotpCodeField';
        
        /**
         * @var ?int
index 82027d21bbcbd692d4c05414bea6f8ed7e496fc2..8fbb393530e2e10ff37fc284ea0a8fc6ff7ce11f 100644 (file)
@@ -31,7 +31,7 @@ class DeviceNode implements IFormChildNode, IFormParentNode {
        /**
         * @inheritDoc
         */
-       protected $templateName = '__totpDeviceNode';
+       protected $templateName = '__multifactorTotpDeviceNode';
        
        /**
         * @inheritDoc
index 3692f2eb6a839eb96e6e0b5e05d1f05eeba17f46..117b0519dfebd6d87d020a64c3c737c67f79b8bf 100644 (file)
@@ -25,7 +25,7 @@ class DevicesContainer extends FormContainer {
        /**
         * @inheritDoc
         */
-       protected $templateName = '__totpDevicesContainer';
+       protected $templateName = '__multifacatorTotpDevicesContainer';
        
        /**
         * @inheritDoc
index b3cf109a0228dabae02d47952cbd4a96fc1b36c5..34434d27ce75f1bf49721131bfee5009077c11c8 100644 (file)
@@ -18,7 +18,7 @@ class NewDeviceContainer extends FormContainer {
        /**
         * @inheritDoc
         */
-       protected $templateName = '__totpNewDeviceContainer';
+       protected $templateName = '__multifactorTotpNewDeviceContainer';
        
        /**
         * @inheritDoc
index c935f50698476a979898ef655d81f8cc9cfa1ffb..30813842b0e842f87d4cdd74eb9e00a6dc6ca8dc 100644 (file)
@@ -20,7 +20,7 @@ class SecretFormField extends AbstractFormField {
        /**
         * @inheritDoc
         */
-       protected $templateName = '__totpSecretField';
+       protected $templateName = '__multifactorTotpSecretField';
        
        public function __construct() {
                $this->value(Totp::generateSecret());