X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FSecurity%2FAuthentication.php;h=c0dc1e9aa7402144a632b2a65a8c22cc062fd531;hb=6db211568ae283d152ee8fa0cfe17a2bab809779;hp=d93f7f9dc5b6bd5cccf1cef7a150e232505b4cec;hpb=69c75daf4f9173573bcfece08a1040612de88c1d;p=friendica.git diff --git a/src/Security/Authentication.php b/src/Security/Authentication.php index d93f7f9dc5..c0dc1e9aa7 100644 --- a/src/Security/Authentication.php +++ b/src/Security/Authentication.php @@ -39,7 +39,6 @@ use Friendica\Util\Network; use Friendica\Util\Strings; use LightOpenID; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Psr\Log\LoggerInterface; /** @@ -306,7 +305,6 @@ class Authentication $this->session->set('new_member', time() < ($member_since + (60 * 60 * 24 * 14))); if (strlen($user_record['timezone'])) { - date_default_timezone_set($user_record['timezone']); $a->setTimeZone($user_record['timezone']); } @@ -343,7 +341,7 @@ class Authentication } } - $this->redirectForTwoFactorAuthentication($user_record['uid'], $a); + $this->redirectForTwoFactorAuthentication($user_record['uid']); if ($interactive) { if ($user_record['login_date'] <= DBA::NULL_DATETIME) { @@ -353,10 +351,11 @@ class Authentication } } - $a->user = $user_record; + $a->setLoggedInUserId($user_record['uid']); + $a->setLoggedInUserNickname($user_record['nickname']); if ($login_initial) { - Hook::callAll('logged_in', $a->user); + Hook::callAll('logged_in', $user_record); if (DI::module()->getName() !== 'home' && $this->session->exists('return_path')) { $this->baseUrl->redirect($this->session->get('return_path')); @@ -369,12 +368,11 @@ class Authentication * All return calls in this method skip two-factor authentication * * @param int $uid The User Identified - * @param App $a The Friendica Application context * * @throws HTTPException\ForbiddenException In case the two factor authentication is forbidden (e.g. for AJAX calls) * @throws HTTPException\InternalServerErrorException */ - private function redirectForTwoFactorAuthentication(int $uid, App $a) + private function redirectForTwoFactorAuthentication(int $uid) { // Check user setting, if 2FA disabled return if (!$this->pConfig->get($uid, '2fa', 'verified')) { @@ -382,7 +380,7 @@ class Authentication } // Check current path, if public or 2fa module return - if ($a->argc > 0 && in_array($a->argv[0], ['2fa', 'view', 'help', 'api', 'proxy', 'logout'])) { + if (DI::args()->getArgc() > 0 && in_array(DI::args()->getArgv()[0], ['2fa', 'view', 'help', 'api', 'proxy', 'logout'])) { return; }