-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3711 from WoltLab/mfa-meta
Multifactor Authentication: Integration branch
- Loading branch information
Showing
76 changed files
with
4,408 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
com.woltlab.wcf/templates/__multifactorAuthenticationLoginAs.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<dl> | ||
<dt>{lang}wcf.user.security.multifactor.authentication.loginAs{/lang}</dt> | ||
<dd>{$user->username}</dd> | ||
</dl> |
17 changes: 17 additions & 0 deletions
17
com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}{* | ||
*}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{lang}wcf.user.security.multifactor.disable.explanation{/lang} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}{* | ||
*}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{lang}wcf.user.security.multifactor.initialBackup{/lang} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}{* | ||
*}> |
4 changes: 4 additions & 0 deletions
4
com.woltlab.wcf/templates/__multifactorTotpDeviceNoDeleteButton.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}–{/if}</td> | ||
<td class="columnText"> | ||
{foreach from=$container item='child'} | ||
{if $child->isAvailable()} | ||
{@$child->getHtml()} | ||
{/if} | ||
{/foreach} | ||
</td> | ||
</tr> |
43 changes: 43 additions & 0 deletions
43
com.woltlab.wcf/templates/__multifactorTotpDevicesContainer.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
46 changes: 46 additions & 0 deletions
46
com.woltlab.wcf/templates/__multifactorTotpNewDeviceContainer.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
15 changes: 15 additions & 0 deletions
15
com.woltlab.wcf/templates/__multifactorTotpSecretField.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<dl> | ||
<dt>{lang}wcf.user.reauthentication.loginAs{/lang}</dt> | ||
<dd>{$__wcf->user->username}</dd> | ||
</dl> |
Oops, something went wrong.