]> git.mxchange.org Git - friendica.git/commitdiff
Improve template args visual alignment in two-factor modules
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 13 May 2019 17:31:08 +0000 (13:31 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 13 May 2019 17:31:08 +0000 (13:31 -0400)
src/Module/Settings/TwoFactor/Index.php
src/Module/Settings/TwoFactor/Recovery.php
src/Module/Settings/TwoFactor/Verify.php
src/Module/TwoFactor/Recovery.php
src/Module/TwoFactor/Verify.php

index 7b803127208b94eea934d5109373bd31259ab9fe..9f02692706a0c72e3343702a731bf914236237f5 100644 (file)
@@ -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'),
-
-                       '$status_title' => L10n::t('Status'),
-                       '$message' => L10n::t('<p>Use an application on a mobile device to get two-factor authentication codes when prompted on login.</p>'),
-
-                       '$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'),
+                       '$title'               => L10n::t('Two-factor authentication'),
+                       '$help_label'          => L10n::t('Help'),
+                       '$status_title'        => L10n::t('Status'),
+                       '$message'             => L10n::t('<p>Use an application on a mobile device to get two-factor authentication codes when prompted on login.</p>'),
+                       '$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'),
                        '$not_configured_message' => L10n::t('<p>You haven\'t finished configuring your authenticator app.</p>'),
-                       '$configured_message' => L10n::t('<p>Your authenticator app is correctly configured.</p>'),
+                       '$configured_message'     => L10n::t('<p>Your authenticator app is correctly configured.</p>'),
 
-                       '$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('<p>These one-use codes can replace an authenticator app code in case you have lost access to it.</p>'),
-
-                       '$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'],
+                       '$recovery_codes_count'     => TwoFactorRecoveryCode::countValidForUser(local_user()),
+                       '$recovery_codes_message'   => L10n::t('<p>These one-use codes can replace an authenticator app code in case you have lost access to it.</p>'),
 
-                       '$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'),
                ]);
        }
 }
index 9f0e74832e6ab6c9fbe4a42e7f97b01b222bd8fc..a2d08cda86cb4def517a817d7a32d4007248de43 100644 (file)
@@ -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('<p>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.</p><p><strong>Put these in a safe spot!</strong> If you lose your device and don’t have the recovery codes you will lose access to your account.</p>'),
-                       '$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('<p>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.</p><p><strong>Put these in a safe spot!</strong> If you lose your device and don’t have the recovery codes you will lose access to your account.</p>'),
+                       '$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'),
                ]);
        }
 }
index 57995cd75cc3091328c8233d6449f674db658f88..caed464ecea8200fd10cd3a9c2642961190f3b52 100644 (file)
@@ -110,19 +110,20 @@ class Verify extends BaseSettingsModule
 </dl>', $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('<p>Please scan this QR Code with your authenticator app and submit the provided code.</p>'),
-                       '$qrcode_image' => $qrcode_image,
+
+                       '$title'              => L10n::t('Two-factor code verification'),
+                       '$help_label'         => L10n::t('Help'),
+                       '$message'            => L10n::t('<p>Please scan this QR Code with your authenticator app and submit the provided code.</p>'),
+                       '$qrcode_image'       => $qrcode_image,
                        '$qrcode_url_message' => L10n::t('<p>Or you can open the following URL in your mobile devicde:</p><p><a href="%s">%s</a></p>', $otpauthUrl, $shortOtpauthUrl),
-                       '$manual_message' => $manual_message,
-                       '$company' => $company,
-                       '$holder' => $holder,
-                       '$secret' => $secret,
+                       '$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_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'),
                ]);
        }
index cd197e030fd6fa76b46246e850a465bb85611edd..4952d220b7ac755bd7210aed3e57aa4422c7e091 100644 (file)
@@ -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('<p>You can enter one of your one-time recovery codes in case you lost access to your mobile device.</p>'),
+
+                       '$title'            => L10n::t('Two-factor recovery'),
+                       '$message'          => L10n::t('<p>You can enter one of your one-time recovery codes in case you lost access to your mobile device.</p>'),
                        '$recovery_message' => L10n::t('Don’t have your phone? <a href="%s">Enter a two-factor recovery code</a>', '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'),
                ]);
        }
 }
index b27c982bd8b66b11940f20fcd90d09756cbf5e32..abe6077c6c7a00e3b37d8453132e9ef413e6d703 100644 (file)
@@ -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('<p>Open the two-factor authentication app on your device to get an authentication code and verify your identity.</p>'),
+
+                       '$title'            => L10n::t('Two-factor authentication'),
+                       '$message'          => L10n::t('<p>Open the two-factor authentication app on your device to get an authentication code and verify your identity.</p>'),
                        '$recovery_message' => L10n::t('Don’t have your phone? <a href="%s">Enter a two-factor recovery code</a>', '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'),
                ]);
        }
 }