diff --git a/src/Module/Settings/TwoFactor/Index.php b/src/Module/Settings/TwoFactor/Index.php index 7b80312720..9f02692706 100644 --- a/src/Module/Settings/TwoFactor/Index.php +++ b/src/Module/Settings/TwoFactor/Index.php @@ -80,32 +80,29 @@ class Index extends BaseSettingsModule return Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/twofactor/index.tpl'), [ '$form_security_token' => self::getFormSecurityToken('settings_2fa'), - '$title' => L10n::t('Two-factor authentication'), - '$help_label' => L10n::t('Help'), + '$title' => L10n::t('Two-factor authentication'), + '$help_label' => L10n::t('Help'), + '$status_title' => L10n::t('Status'), + '$message' => L10n::t('

Use an application on a mobile device to get two-factor authentication codes when prompted on login.

'), + '$has_secret' => $has_secret, + '$verified' => $verified, - '$status_title' => L10n::t('Status'), - '$message' => L10n::t('

Use an application on a mobile device to get two-factor authentication codes when prompted on login.

'), - - '$has_secret' => $has_secret, - '$verified' => $verified, - - '$auth_app_label' => L10n::t('Authenticator app'), - '$app_status' => $has_secret ? $verified ? L10n::t('Configured') : L10n::t('Not Configured') : L10n::t('Disabled'), + '$auth_app_label' => L10n::t('Authenticator app'), + '$app_status' => $has_secret ? $verified ? L10n::t('Configured') : L10n::t('Not Configured') : L10n::t('Disabled'), '$not_configured_message' => L10n::t('

You haven\'t finished configuring your authenticator app.

'), - '$configured_message' => L10n::t('

Your authenticator app is correctly configured.

'), + '$configured_message' => L10n::t('

Your authenticator app is correctly configured.

'), - '$recovery_codes_title' => L10n::t('Recovery codes'), + '$recovery_codes_title' => L10n::t('Recovery codes'), '$recovery_codes_remaining' => L10n::t('Remaining valid codes'), - '$recovery_codes_count' => TwoFactorRecoveryCode::countValidForUser(local_user()), - '$recovery_codes_message' => L10n::t('

These one-use codes can replace an authenticator app code in case you have lost access to it.

'), + '$recovery_codes_count' => TwoFactorRecoveryCode::countValidForUser(local_user()), + '$recovery_codes_message' => L10n::t('

These one-use codes can replace an authenticator app code in case you have lost access to it.

'), - '$action_title' => L10n::t('Actions'), - '$password' => ['password', L10n::t('Current password:'), '', L10n::t('You need to provide your current password to change two-factor authentication settings.'), 'required', 'autofocus'], - - '$enable_label' => L10n::t('Enable two-factor authentication'), - '$disable_label' => L10n::t('Disable two-factor authentication'), + '$action_title' => L10n::t('Actions'), + '$password' => ['password', L10n::t('Current password:'), '', L10n::t('You need to provide your current password to change two-factor authentication settings.'), 'required', 'autofocus'], + '$enable_label' => L10n::t('Enable two-factor authentication'), + '$disable_label' => L10n::t('Disable two-factor authentication'), '$recovery_codes_label' => L10n::t('Show recovery codes'), - '$configure_label' => L10n::t('Finish app configuration'), + '$configure_label' => L10n::t('Finish app configuration'), ]); } } diff --git a/src/Module/Settings/TwoFactor/Recovery.php b/src/Module/Settings/TwoFactor/Recovery.php index 9f0e74832e..a2d08cda86 100644 --- a/src/Module/Settings/TwoFactor/Recovery.php +++ b/src/Module/Settings/TwoFactor/Recovery.php @@ -70,17 +70,17 @@ class Recovery extends BaseSettingsModule $verified = PConfig::get(local_user(), '2fa', 'verified'); return Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/twofactor/recovery.tpl'), [ - '$form_security_token' => self::getFormSecurityToken('settings_2fa_recovery'), + '$form_security_token' => self::getFormSecurityToken('settings_2fa_recovery'), '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'), - '$title' => L10n::t('Two-factor recovery codes'), - '$help_label' => L10n::t('Help'), - '$message' => L10n::t('

Recovery codes can be used to access your account in the event you lose access to your device and cannot receive two-factor authentication codes.

Put these in a safe spot! If you lose your device and don’t have the recovery codes you will lose access to your account.

'), - '$recovery_codes' => $recoveryCodes, - '$password' => ['password', L10n::t('Please enter your password for verification:'), '', L10n::t('You need to provide your current password to enable or disable two-factor authentication.'), 'required', 'autofocus'], + + '$title' => L10n::t('Two-factor recovery codes'), + '$help_label' => L10n::t('Help'), + '$message' => L10n::t('

Recovery codes can be used to access your account in the event you lose access to your device and cannot receive two-factor authentication codes.

Put these in a safe spot! If you lose your device and don’t have the recovery codes you will lose access to your account.

'), + '$recovery_codes' => $recoveryCodes, '$regenerate_message' => L10n::t('When you generate new recovery codes, you must copy the new codes. Your old codes won’t work anymore.'), - '$regenerate_label' => L10n::t('Generate new recovery codes'), - '$verified' => $verified, - '$verify_label' => L10n::t('Next: Verification'), + '$regenerate_label' => L10n::t('Generate new recovery codes'), + '$verified' => $verified, + '$verify_label' => L10n::t('Next: Verification'), ]); } } diff --git a/src/Module/Settings/TwoFactor/Verify.php b/src/Module/Settings/TwoFactor/Verify.php index 57995cd75c..caed464ece 100644 --- a/src/Module/Settings/TwoFactor/Verify.php +++ b/src/Module/Settings/TwoFactor/Verify.php @@ -110,19 +110,20 @@ class Verify extends BaseSettingsModule ', $company, $holder, $secret); return Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/twofactor/verify.tpl'), [ - '$form_security_token' => self::getFormSecurityToken('settings_2fa_verify'), + '$form_security_token' => self::getFormSecurityToken('settings_2fa_verify'), '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'), - '$title' => L10n::t('Two-factor code verification'), - '$help_label' => L10n::t('Help'), - '$message' => L10n::t('

Please scan this QR Code with your authenticator app and submit the provided code.

'), - '$qrcode_image' => $qrcode_image, - '$qrcode_url_message' => L10n::t('

Or you can open the following URL in your mobile devicde:

%s

', $otpauthUrl, $shortOtpauthUrl), - '$manual_message' => $manual_message, - '$company' => $company, - '$holder' => $holder, - '$secret' => $secret, - '$verify_code' => ['verify_code', L10n::t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"'], + '$title' => L10n::t('Two-factor code verification'), + '$help_label' => L10n::t('Help'), + '$message' => L10n::t('

Please scan this QR Code with your authenticator app and submit the provided code.

'), + '$qrcode_image' => $qrcode_image, + '$qrcode_url_message' => L10n::t('

Or you can open the following URL in your mobile devicde:

%s

', $otpauthUrl, $shortOtpauthUrl), + '$manual_message' => $manual_message, + '$company' => $company, + '$holder' => $holder, + '$secret' => $secret, + + '$verify_code' => ['verify_code', L10n::t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"'], '$verify_label' => L10n::t('Verify code and enable two-factor authentication'), ]); } diff --git a/src/Module/TwoFactor/Recovery.php b/src/Module/TwoFactor/Recovery.php index cd197e030f..4952d220b7 100644 --- a/src/Module/TwoFactor/Recovery.php +++ b/src/Module/TwoFactor/Recovery.php @@ -61,11 +61,12 @@ class Recovery extends BaseModule return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/recovery.tpl'), [ '$form_security_token' => self::getFormSecurityToken('twofactor_recovery'), - '$title' => L10n::t('Two-factor recovery'), - '$message' => L10n::t('

You can enter one of your one-time recovery codes in case you lost access to your mobile device.

'), + + '$title' => L10n::t('Two-factor recovery'), + '$message' => L10n::t('

You can enter one of your one-time recovery codes in case you lost access to your mobile device.

'), '$recovery_message' => L10n::t('Don’t have your phone? Enter a two-factor recovery code', '2fa/recovery'), - '$recovery_code' => ['recovery_code', L10n::t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'], - '$recovery_label' => L10n::t('Submit recovery code and complete login'), + '$recovery_code' => ['recovery_code', L10n::t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'], + '$recovery_label' => L10n::t('Submit recovery code and complete login'), ]); } } diff --git a/src/Module/TwoFactor/Verify.php b/src/Module/TwoFactor/Verify.php index b27c982bd8..abe6077c6c 100644 --- a/src/Module/TwoFactor/Verify.php +++ b/src/Module/TwoFactor/Verify.php @@ -56,11 +56,12 @@ class Verify extends BaseModule return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/verify.tpl'), [ '$form_security_token' => self::getFormSecurityToken('twofactor_verify'), - '$title' => L10n::t('Two-factor authentication'), - '$message' => L10n::t('

Open the two-factor authentication app on your device to get an authentication code and verify your identity.

'), + + '$title' => L10n::t('Two-factor authentication'), + '$message' => L10n::t('

Open the two-factor authentication app on your device to get an authentication code and verify your identity.

'), '$recovery_message' => L10n::t('Don’t have your phone? Enter a two-factor recovery code', '2fa/recovery'), - '$verify_code' => ['verify_code', L10n::t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"'], - '$verify_label' => L10n::t('Verify code and complete login'), + '$verify_code' => ['verify_code', L10n::t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"'], + '$verify_label' => L10n::t('Verify code and complete login'), ]); } }