mirror of
https://github.com/friendica/friendica
synced 2025-04-25 09:50:11 +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
|
@ -26,7 +26,6 @@ use Friendica\Content\Nav;
|
|||
use Friendica\Content\Pager;
|
||||
use Friendica\Content\Widget;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Search;
|
||||
use Friendica\DI;
|
||||
|
@ -44,12 +43,12 @@ class Directory extends BaseModule
|
|||
$app = DI::app();
|
||||
$config = DI::config();
|
||||
|
||||
if (($config->get('system', 'block_public') && !Session::isAuthenticated()) ||
|
||||
($config->get('system', 'block_local_dir') && !Session::isAuthenticated())) {
|
||||
if (($config->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) ||
|
||||
($config->get('system', 'block_local_dir') && !DI::userSession()->isAuthenticated())) {
|
||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
|
||||
}
|
||||
|
||||
if (Session::getLocalUser()) {
|
||||
if (DI::userSession()->getLocalUserId()) {
|
||||
DI::page()['aside'] .= Widget::findPeople();
|
||||
DI::page()['aside'] .= Widget::follow();
|
||||
}
|
||||
|
@ -75,7 +74,7 @@ class Directory extends BaseModule
|
|||
DI::sysmsg()->addNotice(DI::l10n()->t('No entries (some entries may be hidden).'));
|
||||
} else {
|
||||
foreach ($profiles['entries'] as $entry) {
|
||||
$contact = Model\Contact::getByURLForUser($entry['url'], Session::getLocalUser());
|
||||
$contact = Model\Contact::getByURLForUser($entry['url'], DI::userSession()->getLocalUserId());
|
||||
if (!empty($contact)) {
|
||||
$entries[] = Contact::getContactTemplateVars($contact);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue