From: Matthias Schmidt Date: Mon, 21 Dec 2020 12:07:47 +0000 (+0100) Subject: Add autocomplete support for multifactor email code form field X-Git-Tag: 5.4.0_Alpha_1~521^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=833eaffe66c1228bb6528a8df1f656a81b8be130;p=GitHub%2FWoltLab%2FWCF.git Add autocomplete support for multifactor email code form field --- diff --git a/com.woltlab.wcf/templates/__multifactorEmailCodeField.tpl b/com.woltlab.wcf/templates/__multifactorEmailCodeField.tpl index 7b596894d9..804df0de78 100644 --- a/com.woltlab.wcf/templates/__multifactorEmailCodeField.tpl +++ b/com.woltlab.wcf/templates/__multifactorEmailCodeField.tpl @@ -3,7 +3,7 @@ *}name="{@$field->getPrefixedId()}" {* *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {* *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{* - *}autocomplete="off" {* + *}{if $field->getAutoComplete() !== null}autocomplete="{$field->getAutoComplete()}" {/if}{* *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{* *}pattern="[0-9]*" {* *}inputmode="numeric"{* diff --git a/wcfsetup/install/files/acp/templates/__multifactorEmailCodeField.tpl b/wcfsetup/install/files/acp/templates/__multifactorEmailCodeField.tpl index 7b596894d9..804df0de78 100644 --- a/wcfsetup/install/files/acp/templates/__multifactorEmailCodeField.tpl +++ b/wcfsetup/install/files/acp/templates/__multifactorEmailCodeField.tpl @@ -3,7 +3,7 @@ *}name="{@$field->getPrefixedId()}" {* *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {* *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{* - *}autocomplete="off" {* + *}{if $field->getAutoComplete() !== null}autocomplete="{$field->getAutoComplete()}" {/if}{* *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{* *}pattern="[0-9]*" {* *}inputmode="numeric"{* diff --git a/wcfsetup/install/files/lib/system/user/multifactor/email/CodeFormField.class.php b/wcfsetup/install/files/lib/system/user/multifactor/email/CodeFormField.class.php index 24b111539d..0b2ef777f2 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/email/CodeFormField.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/email/CodeFormField.class.php @@ -26,6 +26,7 @@ class CodeFormField extends TextFormField { $this->minimumLength(EmailMultifactorMethod::LENGTH); $this->maximumLength(EmailMultifactorMethod::LENGTH); $this->addFieldClass('multifactorEmailCode'); + $this->autoComplete('off'); $placeholder = ''; $gen = Helper::digitStream();