X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FHome.php;h=c202fbfcd9334ffb8540bf82d97c9699c5cb81ff;hb=dd534919d7e3af010bbc2477e3d0e89a47dd0872;hp=6ce025208ac4690113a5a9f888df78744fca1f03;hpb=5dfee31108fc92a7abca5f99b8fdf1b34aec5dd5;p=friendica.git diff --git a/src/Module/Home.php b/src/Module/Home.php index 6ce025208a..c202fbfcd9 100644 --- a/src/Module/Home.php +++ b/src/Module/Home.php @@ -1,20 +1,47 @@ . + * + */ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\DI; +use Friendica\Model\User; use Friendica\Module\Security\Login; +use Friendica\Protocol\ActivityPub; /** * Home module - Landing page of the current node */ class Home extends BaseModule { - public static function content(array $parameters = []) + protected function rawContent(array $request = []) + { + if (ActivityPub::isRequest()) { + DI::baseUrl()->redirect(User::getActorName()); + } + } + + protected function content(array $request = []): string { $app = DI::app(); $config = DI::config(); @@ -24,11 +51,11 @@ class Home extends BaseModule Hook::callAll('home_init', $ret); - if (local_user() && ($app->user['nickname'])) { + if (DI::userSession()->getLocalUserId() && ($app->getLoggedInUserNickname())) { DI::baseUrl()->redirect('network'); } - if (strlen($config->get('system', 'singleuser'))) { + if ($config->get('system', 'singleuser')) { DI::baseUrl()->redirect('/profile/' . $config->get('system', 'singleuser')); } @@ -42,7 +69,7 @@ class Home extends BaseModule $customHome = $homeFilePath; if (file_exists($cssFilePath)) { - DI::page()['htmlhead'] .= ''; + DI::page()->registerStylesheet('home.css', 'all'); } }