mirror of
https://github.com/friendica/friendica
synced 2025-04-24 13:50:10 +00: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
|
@ -23,7 +23,6 @@ namespace Friendica\Module\Contact;
|
|||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
|
@ -41,7 +40,7 @@ class Hovercard extends BaseModule
|
|||
$contact_url = $_REQUEST['url'] ?? '';
|
||||
|
||||
// Get out if the system doesn't have public access allowed
|
||||
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
|
||||
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
|
||||
throw new HTTPException\ForbiddenException();
|
||||
}
|
||||
|
||||
|
@ -70,8 +69,8 @@ class Hovercard extends BaseModule
|
|||
|
||||
// Search for contact data
|
||||
// Look if the local user has got the contact
|
||||
if (Session::isAuthenticated()) {
|
||||
$contact = Contact::getByURLForUser($contact_url, Session::getLocalUser());
|
||||
if (DI::userSession()->isAuthenticated()) {
|
||||
$contact = Contact::getByURLForUser($contact_url, DI::userSession()->getLocalUserId());
|
||||
} else {
|
||||
$contact = Contact::getByURL($contact_url, false);
|
||||
}
|
||||
|
@ -81,7 +80,7 @@ class Hovercard extends BaseModule
|
|||
}
|
||||
|
||||
// Get the photo_menu - the menu if possible contact actions
|
||||
if (Session::isAuthenticated()) {
|
||||
if (DI::userSession()->isAuthenticated()) {
|
||||
$actions = Contact::photoMenu($contact);
|
||||
} else {
|
||||
$actions = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue