]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Settings/TwoFactor/Trusted.php
Merge pull request #11015 from MrPetovan/task/10979-frio-time-tooltip
[friendica.git] / src / Module / Settings / TwoFactor / Trusted.php
index 7ea001c949c31a651cf8e7d9f4bb513589cae034..844cd4dff4c9b91e60d7fae0f465db8bafe70fed 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
 use Friendica\Module\BaseSettings;
 use Friendica\Security\TwoFactor;
+use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Temporal;
 use UAParser\Parser;
 
@@ -42,7 +43,7 @@ class Trusted extends BaseSettings
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
-                       notice($this->l10n->t('Please enter your password to access this page.'));
+                       notice($this->t('Please enter your password to access this page.'));
                        $this->baseUrl->redirect('settings/2fa');
                }
        }
@@ -59,7 +60,7 @@ class Trusted extends BaseSettings
                        switch ($_POST['action']) {
                                case 'remove_all' :
                                        $this->trustedBrowserRepo->removeAllForUser(local_user());
-                                       info($this->l10n->t('Trusted browsers successfully removed.'));
+                                       info($this->t('Trusted browsers successfully removed.'));
                                        $this->baseUrl->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        break;
                        }
@@ -69,7 +70,7 @@ class Trusted extends BaseSettings
                        self::checkFormSecurityTokenRedirectOnError('settings/2fa/trusted', 'settings_2fa_trusted');
 
                        if ($this->trustedBrowserRepo->removeForUser(local_user(), $_POST['remove_id'])) {
-                               info($this->l10n->t('Trusted browser successfully removed.'));
+                               info($this->t('Trusted browser successfully removed.'));
                        }
 
                        $this->baseUrl->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password'));
@@ -88,7 +89,11 @@ class Trusted extends BaseSettings
                $trustedBrowserDisplay = array_map(function (TwoFactor\Model\TrustedBrowser $trustedBrowser) use ($parser) {
                        $dates = [
                                'created_ago' => Temporal::getRelativeDate($trustedBrowser->created),
+                               'created_utc' => DateTimeFormat::utc($trustedBrowser->created, 'c'),
+                               'created_local' => DateTimeFormat::local($trustedBrowser->created, 'r'),
                                'last_used_ago' => Temporal::getRelativeDate($trustedBrowser->last_used),
+                               'last_used_utc' => DateTimeFormat::utc($trustedBrowser->last_used, 'c'),
+                               'last_used_local' => DateTimeFormat::local($trustedBrowser->last_used, 'r'),
                        ];
 
                        $result = $parser->parse($trustedBrowser->user_agent);
@@ -106,15 +111,15 @@ class Trusted extends BaseSettings
                        '$form_security_token' => self::getFormSecurityToken('settings_2fa_trusted'),
                        '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'),
 
-                       '$title'               => $this->l10n->t('Two-factor Trusted Browsers'),
-                       '$message'             => $this->l10n->t('Trusted browsers are individual browsers you chose to skip two-factor authentication to access Friendica. Please use this feature sparingly, as it can negate the benefit of two-factor authentication.'),
-                       '$device_label'        => $this->l10n->t('Device'),
-                       '$os_label'            => $this->l10n->t('OS'),
-                       '$browser_label'       => $this->l10n->t('Browser'),
-                       '$created_label'       => $this->l10n->t('Trusted'),
-                       '$last_used_label'     => $this->l10n->t('Last Use'),
-                       '$remove_label'        => $this->l10n->t('Remove'),
-                       '$remove_all_label'    => $this->l10n->t('Remove All'),
+                       '$title'               => $this->t('Two-factor Trusted Browsers'),
+                       '$message'             => $this->t('Trusted browsers are individual browsers you chose to skip two-factor authentication to access Friendica. Please use this feature sparingly, as it can negate the benefit of two-factor authentication.'),
+                       '$device_label'        => $this->t('Device'),
+                       '$os_label'            => $this->t('OS'),
+                       '$browser_label'       => $this->t('Browser'),
+                       '$created_label'       => $this->t('Trusted'),
+                       '$last_used_label'     => $this->t('Last Use'),
+                       '$remove_label'        => $this->t('Remove'),
+                       '$remove_all_label'    => $this->t('Remove All'),
 
                        '$trusted_browsers'    => $trustedBrowserDisplay,
                ]);