mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 08:14:25 +02:00
UserSession class [5] - Refactor src/Module/ files with DI
This commit is contained in:
parent
a729f3255d
commit
eecc456e0c
78 changed files with 455 additions and 530 deletions
|
@ -25,7 +25,6 @@ use Friendica\App;
|
|||
use Friendica\BaseModule;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\Session\Capability\IHandleSessions;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\User\Cookie;
|
||||
|
@ -62,7 +61,7 @@ class SignOut extends BaseModule
|
|||
|
||||
protected function post(array $request = [])
|
||||
{
|
||||
if (!Session::getLocalUser() || !($this->cookie->get('2fa_cookie_hash'))) {
|
||||
if (!DI::userSession()->getLocalUserId() || !($this->cookie->get('2fa_cookie_hash'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -81,7 +80,7 @@ class SignOut extends BaseModule
|
|||
$this->baseUrl->redirect();
|
||||
break;
|
||||
case 'sign_out':
|
||||
$this->trustedBrowserRepository->removeForUser(Session::getLocalUser(), $this->cookie->get('2fa_cookie_hash'));
|
||||
$this->trustedBrowserRepository->removeForUser(DI::userSession()->getLocalUserId(), $this->cookie->get('2fa_cookie_hash'));
|
||||
$this->cookie->clear();
|
||||
$this->session->clear();
|
||||
|
||||
|
@ -96,7 +95,7 @@ class SignOut extends BaseModule
|
|||
|
||||
protected function content(array $request = []): string
|
||||
{
|
||||
if (!Session::getLocalUser() || !($this->cookie->get('2fa_cookie_hash'))) {
|
||||
if (!DI::userSession()->getLocalUserId() || !($this->cookie->get('2fa_cookie_hash'))) {
|
||||
$this->baseUrl->redirect();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue