1
0
Fork 0

UserSession class [3] - Refactor src/ files excluding Module/Model

This commit is contained in:
Philipp Holzer 2022-10-20 21:22:47 +02:00
commit b3f9cef94a
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
23 changed files with 120 additions and 133 deletions

View file

@ -62,7 +62,7 @@ class ACL
$page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css'));
$page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css'));
$contacts = self::getValidMessageRecipientsForUser(Session::getLocalUser());
$contacts = self::getValidMessageRecipientsForUser(DI::userSession()->getLocalUserId());
$tpl = Renderer::getMarkupTemplate('acl/message_recipient.tpl');
$o = Renderer::replaceMacros($tpl, [

View file

@ -70,7 +70,7 @@ class Search
return $emptyResultList;
}
$contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', Session::getLocalUser());
$contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', DI::userSession()->getLocalUserId());
$result = new ContactResult(
$user_data['name'] ?? '',
@ -136,7 +136,7 @@ class Search
foreach ($profiles as $profile) {
$profile_url = $profile['profile_url'] ?? '';
$contactDetails = Contact::getByURLForUser($profile_url, Session::getLocalUser());
$contactDetails = Contact::getByURLForUser($profile_url, DI::userSession()->getLocalUserId());
$result = new ContactResult(
$profile['name'] ?? '',
@ -211,7 +211,7 @@ class Search
{
Logger::info('Searching', ['search' => $search, 'mode' => $mode, 'page' => $page]);
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
return [];
}