Cleanup plugin languages

This commit is contained in:
djmaze 2021-07-23 16:18:23 +02:00
parent 8b760ef0d1
commit d1f43f49b7
10 changed files with 14 additions and 65 deletions

View file

@ -12,10 +12,6 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin
CATEGORY = 'Login', CATEGORY = 'Login',
DESCRIPTION = 'This plugin allows you to have TOTP 2FA'; DESCRIPTION = 'This plugin allows you to have TOTP 2FA';
const
AccountTwoFactorAuthRequired = 120,
AccountTwoFactorAuthError = 121;
public function Init() : void public function Init() : void
{ {
$this->UseLangs(true); $this->UseLangs(true);
@ -44,11 +40,10 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin
if ($aData && isset($aData['IsSet'], $aData['Enable']) && !empty($aData['Secret']) && $aData['IsSet'] && $aData['Enable']) { if ($aData && isset($aData['IsSet'], $aData['Enable']) && !empty($aData['Secret']) && $aData['IsSet'] && $aData['Enable']) {
$sCode = \trim($this->jsonParam('totp_code', '')); $sCode = \trim($this->jsonParam('totp_code', ''));
if (empty($sCode)) { if (empty($sCode)) {
$this->Logger()->Write("TFA: Required Code for {$oAccount->ParentEmailHelper()} account."); $this->Logger()->Write("TFA: Code required for {$oAccount->ParentEmailHelper()}");
throw new ClientException(static::AccountTwoFactorAuthRequired); throw new ClientException(\RainLoop\Notifications::AuthError);
} }
$this->Logger()->Write("TFA: Verify Code for {$oAccount->ParentEmailHelper()} account.");
$bUseBackupCode = false; $bUseBackupCode = false;
if (6 < \strlen($sCode) && !empty($aData['BackupCodes'])) { if (6 < \strlen($sCode) && !empty($aData['BackupCodes'])) {
$aBackupCodes = \explode(' ', \trim(\preg_replace('/[^\d]+/', ' ', $aData['BackupCodes']))); $aBackupCodes = \explode(' ', \trim(\preg_replace('/[^\d]+/', ' ', $aData['BackupCodes'])));
@ -60,8 +55,10 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin
if (!$bUseBackupCode && !$this->TwoFactorAuthProvider($oAccount)->VerifyCode($aData['Secret'], $sCode)) { if (!$bUseBackupCode && !$this->TwoFactorAuthProvider($oAccount)->VerifyCode($aData['Secret'], $sCode)) {
$this->Manager()->Actions()->LoggerAuthHelper($oAccount); $this->Manager()->Actions()->LoggerAuthHelper($oAccount);
throw new ClientException(static::AccountTwoFactorAuthError); $this->Logger()->Write("TFA: Code failed for {$oAccount->ParentEmailHelper()}");
throw new ClientException(\RainLoop\Notifications::AuthError);
} }
$this->Logger()->Write("TFA: Code verified for {$oAccount->ParentEmailHelper()}");
} }
} }
} }

View file

@ -4,7 +4,7 @@
rl && addEventListener('rl-view-model', e => { rl && addEventListener('rl-view-model', e => {
if (e.detail && 'Login' === e.detail.viewModelTemplateID) { if (e.detail && 'Login' === e.detail.viewModelTemplateID) {
const container = e.detail.viewModelDom.querySelector('#plugin-Login-BottomControlGroup'), const container = e.detail.viewModelDom.querySelector('#plugin-Login-BottomControlGroup'),
placeholder = 'LOGIN/LABEL_VERIFICATION_CODE'; placeholder = 'LOGIN/LABEL_TWO_FACTOR_CODE';
if (container) { if (container) {
container.prepend(Element.fromHTML('<div class="controls">' container.prepend(Element.fromHTML('<div class="controls">'
+ '<div class="input-append">' + '<div class="input-append">'

View file

@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "Sie können diese Einstellung nicht ohne v
[POPUPS_TWO_FACTOR_TEST] [POPUPS_TWO_FACTOR_TEST]
TITLE_TEST_CODE = "Zwei-Faktor-Authentifizierung" TITLE_TEST_CODE = "Zwei-Faktor-Authentifizierung"
LABEL_CODE = "Code" LABEL_CODE = "Code"
[SETTINGS_SECURITY]
LABEL_CONFIGURE_TWO_FACTOR = "Zwei-Faktor-Authentifizierung konfigurieren"
[NOTIFICATIONS]
ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Zwei-Faktor-Authentifizierung erforderlich"
ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Fehler bei Zwei-Faktor-Authentifizierung"
[LOGIN] [LOGIN]
LABEL_VERIFICATION_CODE = "Verifizierungscode" LABEL_TWO_FACTOR_CODE = "Verifizierungscode"
LABEL_DONT_ASK_VERIFICATION_CODE = "Für zwei Wochen nicht nach dem Code fragen"

View file

@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "Not configured"
TWO_FACTOR_SECRET_DESC = "Import this info into your Google Authenticator client (or other TOTP client) using the provided QR code below or by entering the code manually.\n" TWO_FACTOR_SECRET_DESC = "Import this info into your Google Authenticator client (or other TOTP client) using the provided QR code below or by entering the code manually.\n"
TWO_FACTOR_BACKUP_CODES_DESC = "If you can't receive codes via Google Authenticator (or other TOTP client), you can use backup codes to sign in. After youve used a backup code to sign in, it will become inactive.\n" TWO_FACTOR_BACKUP_CODES_DESC = "If you can't receive codes via Google Authenticator (or other TOTP client), you can use backup codes to sign in. After youve used a backup code to sign in, it will become inactive.\n"
TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "You can't change this setting before test." TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "You can't change this setting before test."
[SETTINGS_SECURITY]
LABEL_CONFIGURE_TWO_FACTOR = "Configure 2-Step verification"
[NOTIFICATIONS]
ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Two factor verification required"
ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Two factor verification error"
[LOGIN] [LOGIN]
LABEL_VERIFICATION_CODE = "Verification Code" LABEL_TWO_FACTOR_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"

View file

@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "No configurado"
TWO_FACTOR_SECRET_DESC = "Importar esta información en su cliente Google Authenticator (u otro cliente TOTP) utilizando el código QR se indica debajo o introduciendo el código manualmente." TWO_FACTOR_SECRET_DESC = "Importar esta información en su cliente Google Authenticator (u otro cliente TOTP) utilizando el código QR se indica debajo o introduciendo el código manualmente."
TWO_FACTOR_BACKUP_CODES_DESC = "Si usted no puede recibir los códigos a través de Google Authenticator, puede utilizar códigos de copia de seguridad para firmar pulg Después de que usted ha utilizado un código de copia de seguridad para iniciar sesión, se convertirá en inactiva." TWO_FACTOR_BACKUP_CODES_DESC = "Si usted no puede recibir los códigos a través de Google Authenticator, puede utilizar códigos de copia de seguridad para firmar pulg Después de que usted ha utilizado un código de copia de seguridad para iniciar sesión, se convertirá en inactiva."
TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "You can't change this setting before test." TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "You can't change this setting before test."
[SETTINGS_SECURITY]
LABEL_CONFIGURE_TWO_FACTOR = "Configurar verificación de 2-Pasos"
[NOTIFICATIONS]
ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Factor de verificación en dos pasos requerido"
ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Error de verificación en dos pasos"
[LOGIN] [LOGIN]
LABEL_VERIFICATION_CODE = "Código de verificación" LABEL_TWO_FACTOR_CODE = "Código de verificación"
LABEL_DONT_ASK_VERIFICATION_CODE = "No solicitar el código de verificación durante 2 semanas"

View file

@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "Vous ne pouvez pas modifier ce paramètre
[POPUPS_TWO_FACTOR_TEST] [POPUPS_TWO_FACTOR_TEST]
TITLE_TEST_CODE = "Test d'authentification en deux étapes" TITLE_TEST_CODE = "Test d'authentification en deux étapes"
LABEL_CODE = "Code" LABEL_CODE = "Code"
[SETTINGS_SECURITY]
LABEL_CONFIGURE_TWO_FACTOR = "Configurer l'authentification en deux étapes"
[NOTIFICATIONS]
ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Double authentification requise"
ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Erreur lors de la double authentification"
[LOGIN] [LOGIN]
LABEL_VERIFICATION_CODE = "Code de vérification" LABEL_TWO_FACTOR_CODE = "Code de vérification"
LABEL_DONT_ASK_VERIFICATION_CODE = "Ne plus demander le code pendant 2 semaines"

View file

@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "Tesztelés nélkül nem lehet megváltozta
[POPUPS_TWO_FACTOR_TEST] [POPUPS_TWO_FACTOR_TEST]
TITLE_TEST_CODE = "2-lépéses hitelesítés teszt" TITLE_TEST_CODE = "2-lépéses hitelesítés teszt"
LABEL_CODE = "Kód" LABEL_CODE = "Kód"
[SETTINGS_SECURITY]
LABEL_CONFIGURE_TWO_FACTOR = "2 lépcsős hitelesítés beállítása"
[NOTIFICATIONS]
ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Kétlépcsős azonosítás kötelező"
ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Kétlépcsős azonosítás hiba"
[LOGIN] [LOGIN]
LABEL_VERIFICATION_CODE = "Megerősítő kód" LABEL_TWO_FACTOR_CODE = "Megerősítő kód"
LABEL_DONT_ASK_VERIFICATION_CODE = "Két hétig ne kérje a kódot"

View file

@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "U kunt 2-stap verificatie niet activeren v
[POPUPS_TWO_FACTOR_TEST] [POPUPS_TWO_FACTOR_TEST]
TITLE_TEST_CODE = "2-Stap verificatie test" TITLE_TEST_CODE = "2-Stap verificatie test"
LABEL_CODE = "Code" LABEL_CODE = "Code"
[SETTINGS_SECURITY]
LABEL_CONFIGURE_TWO_FACTOR = "Configureer 2-stap verificatie"
[NOTIFICATIONS]
ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "2-Stap verificatie vereist"
ACCOUNT_TWO_FACTOR_AUTH_ERROR = "2-Stap verificatie fout"
[LOGIN] [LOGIN]
LABEL_VERIFICATION_CODE = "Verificatie Code" LABEL_TWO_FACTOR_CODE = "Verificatie Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Vraag 2 weken niet naar code"

View file

@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "Du kan inte ändra denna inställning inna
[POPUPS_TWO_FACTOR_TEST] [POPUPS_TWO_FACTOR_TEST]
TITLE_TEST_CODE = "Tvåstegsverifieringstest" TITLE_TEST_CODE = "Tvåstegsverifieringstest"
LABEL_CODE = "Kod" LABEL_CODE = "Kod"
[SETTINGS_SECURITY]
LABEL_CONFIGURE_TWO_FACTOR = "Konfigurera tvåstegsverifiering"
[NOTIFICATIONS]
ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Tvåstegsverifiering krävs"
ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Tvåstegsverifieringsfel"
[LOGIN] [LOGIN]
LABEL_VERIFICATION_CODE = "Verifikationskod" LABEL_TWO_FACTOR_CODE = "Verifikationskod"
LABEL_DONT_ASK_VERIFICATION_CODE = "Fråga inte efter koden på 2 veckor"

View file

@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "完成测试前你无法更改此设置。
[POPUPS_TWO_FACTOR_TEST] [POPUPS_TWO_FACTOR_TEST]
TITLE_TEST_CODE = "两步验证测试" TITLE_TEST_CODE = "两步验证测试"
LABEL_CODE = "代码" LABEL_CODE = "代码"
[SETTINGS_SECURITY]
LABEL_CONFIGURE_TWO_FACTOR = "配置两步验证"
[NOTIFICATIONS]
ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "需要进行两步验证"
ACCOUNT_TWO_FACTOR_AUTH_ERROR = "两步验证错误"
[LOGIN] [LOGIN]
LABEL_VERIFICATION_CODE = "验证码" LABEL_TWO_FACTOR_CODE = "验证码"
LABEL_DONT_ASK_VERIFICATION_CODE = "在两周内不再询问验证码"