From e99f6863d9510cd511a8f96561b62c23cb80c021 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 9 Dec 2020 11:43:16 +0100 Subject: [PATCH] Add missing language item --- .../multifactor/BackupMultifactorMethod.class.php | 5 ++++- .../multifactor/EmailMultifactorMethod.class.php | 5 ++++- .../multifactor/TotpMultifactorMethod.class.php | 13 ++++++++++--- wcfsetup/install/lang/de.xml | 1 + wcfsetup/install/lang/en.xml | 1 + 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php b/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php index 8d63feb11f..a7270d32bf 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/BackupMultifactorMethod.class.php @@ -272,7 +272,10 @@ class BackupMultifactorMethod implements IMultifactorMethod { if ($this->findValidCode($userCode, $codes) === null) { $field->value(''); - $field->addValidationError(new FormFieldValidationError('invalid')); + $field->addValidationError(new FormFieldValidationError( + 'invalidCode', + 'wcf.user.security.multifactor.error.invalidCode' + )); } })), ]); diff --git a/wcfsetup/install/files/lib/system/user/multifactor/EmailMultifactorMethod.class.php b/wcfsetup/install/files/lib/system/user/multifactor/EmailMultifactorMethod.class.php index 740ae8144c..58799f51a6 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/EmailMultifactorMethod.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/EmailMultifactorMethod.class.php @@ -201,7 +201,10 @@ class EmailMultifactorMethod implements IMultifactorMethod { if ($this->findValidCode($userCode, $codes) === null) { $field->value(''); - $field->addValidationError(new FormFieldValidationError('invalid')); + $field->addValidationError(new FormFieldValidationError( + 'invalidCode', + 'wcf.user.security.multifactor.error.invalidCode' + )); } })), ]); diff --git a/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php b/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php index 6a7e1ce03d..e1e1fa79bd 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php @@ -81,7 +81,10 @@ class TotpMultifactorMethod implements IMultifactorMethod { $minCounter = 0; if (!$totp->validateTotpCode($field->getValue(), $minCounter, new \DateTime())) { $field->value(''); - $field->addValidationError(new FormFieldValidationError('invalid')); + $field->addValidationError(new FormFieldValidationError( + 'invalidCode', + 'wcf.user.security.multifactor.error.invalidCode' + )); } $field->minCounter($minCounter); })), @@ -310,14 +313,18 @@ class TotpMultifactorMethod implements IMultifactorMethod { } } if ($selectedDevice === null) { - $field->addValidationError(new FormFieldValidationError('invalid')); + // This should never happen. + $field->addValidationError(new FormFieldValidationError('unreachable')); } $totp = new Totp($selectedDevice['secret']); $minCounter = $selectedDevice['minCounter']; if (!$totp->validateTotpCode($field->getValue(), $minCounter, new \DateTime())) { $field->value(''); - $field->addValidationError(new FormFieldValidationError('invalid')); + $field->addValidationError(new FormFieldValidationError( + 'invalidCode', + 'wcf.user.security.multifactor.error.invalidCode' + )); } $field->minCounter($minCounter); })), diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 4e9eadc0ef..63a125b164 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -4959,6 +4959,7 @@ Die E-Mail-Adresse des neuen Benutzers lautet: {@$user->email} {if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} auch eine Liste von Notfallcodes erhalten, falls der zusätzliche Faktor unbrauchbar werden sollte. **{if LANGUAGE_USE_INFORMAL_VARIANT}Hast du dir{else}Haben Sie sich{/if} die Notfallcodes notiert?** Falls {if LANGUAGE_USE_INFORMAL_VARIANT}du es vergessen hast, kannst du{else}Sie es vergessen haben, können Sie{/if} dies nachholen, indem {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} in der Verwaltung der Notfallcodes [URL:{link controller='MultifactorManage' object=$backupMethod isEmail=true}{/link}] neue Notfallcodes {if LANGUAGE_USE_INFORMAL_VARIANT}generierst{else}generieren{/if}.]]> {if LANGUAGE_USE_INFORMAL_VARIANT}logge dich{else}loggen Sie sich{/if} erneut ein.]]> {$user->username} ist mit der Mehrfaktor-Authentifizierung geschützt, es sind jedoch keine aktiven Verfahren verfügbar. Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}wende dich{else}wenden Sie sich{/if} an den Administrator.]]> + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 3ae070544d..5c8f127f3f 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -4956,6 +4956,7 @@ You successfully enabled multi-factor authentication using the „{lang}wcf.user You also received a list of emergency codes to use when your second factor becomes unavailable. **Did you store these emergency codes securely?** If you forgot you can do now by generating new codes in the Emergency Code Management [URL:{link controller='MultifactorManage' object=$backupMethod isEmail=true}{/link}].]]> Login once again.]]> {$user->username} is protected by multi-factor authentication, but no methods are set up. Please contact the administrator for support.]]> + -- 2.20.1