]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/TwoFactor/Recovery.php
Remove uneeded variable.
[friendica.git] / src / Module / TwoFactor / Recovery.php
index cd197e030fd6fa76b46246e850a465bb85611edd..60f443c35ffe88bc54cf0658c52625c8b394f40d 100644 (file)
@@ -6,7 +6,7 @@ use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session;
-use Friendica\Model\TwoFactorRecoveryCode;
+use Friendica\Model\TwoFactor\RecoveryCode;
 
 /**
  * // Page 1a: Recovery code verification
@@ -35,10 +35,10 @@ class Recovery extends BaseModule
 
                        $recovery_code = defaults($_POST, 'recovery_code', '');
 
-                       if (TwoFactorRecoveryCode::existsForUser(local_user(), $recovery_code)) {
-                               TwoFactorRecoveryCode::markUsedForUser(local_user(), $recovery_code);
+                       if (RecoveryCode::existsForUser(local_user(), $recovery_code)) {
+                               RecoveryCode::markUsedForUser(local_user(), $recovery_code);
                                Session::set('2fa', true);
-                               notice(L10n::t('Remaining recovery codes: %d', TwoFactorRecoveryCode::countValidForUser(local_user())));
+                               notice(L10n::t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
 
                                // Resume normal login workflow
                                Session::setAuthenticatedForUser($a, $a->user, true, true);
@@ -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'),
                ]);
        }
 }