]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Settings/TwoFactor/Index.php
Move title attribute to <time> tag
[friendica.git] / src / Module / Settings / TwoFactor / Index.php
index 8cc04787f5efae4345bb85475bbb455403466702..0dcef14ad9deb17d55bf527f9f72946fdb608132 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -24,8 +24,8 @@ namespace Friendica\Module\Settings\TwoFactor;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session;
 use Friendica\DI;
-use Friendica\Model\TwoFactor\AppSpecificPassword;
-use Friendica\Model\TwoFactor\RecoveryCode;
+use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
+use Friendica\Security\TwoFactor\Model\RecoveryCode;
 use Friendica\Model\User;
 use Friendica\Module\BaseSettings;
 use Friendica\Module\Security\Login;
@@ -33,7 +33,7 @@ use PragmaRX\Google2FA\Google2FA;
 
 class Index extends BaseSettings
 {
-       public static function post(array $parameters = [])
+       public function post()
        {
                if (!local_user()) {
                        return;
@@ -78,6 +78,11 @@ class Index extends BaseSettings
                                                DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        }
                                        break;
+                               case 'trusted':
+                                       if ($has_secret) {
+                                               DI::baseUrl()->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password'));
+                                       }
+                                       break;
                                case 'configure':
                                        if (!$verified) {
                                                DI::baseUrl()->redirect('settings/2fa/verify?t=' . self::getFormSecurityToken('settings_2fa_password'));
@@ -89,13 +94,13 @@ class Index extends BaseSettings
                }
        }
 
-       public static function content(array $parameters = [])
+       public function content(): string
        {
                if (!local_user()) {
                        return Login::form('settings/2fa');
                }
 
-               parent::content($parameters);
+               parent::content();
 
                $has_secret = (bool) DI::pConfig()->get(local_user(), '2fa', 'secret');
                $verified = DI::pConfig()->get(local_user(), '2fa', 'verified');
@@ -130,6 +135,7 @@ class Index extends BaseSettings
                        '$disable_label'        => DI::l10n()->t('Disable two-factor authentication'),
                        '$recovery_codes_label' => DI::l10n()->t('Show recovery codes'),
                        '$app_specific_passwords_label' => DI::l10n()->t('Manage app-specific passwords'),
+                       '$trusted_browsers_label' => DI::l10n()->t('Manage trusted browsers'),
                        '$configure_label'      => DI::l10n()->t('Finish app configuration'),
                ]);
        }