<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Core\Hook;
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()
+ 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();
Hook::callAll('home_init', $ret);
- if (local_user() && ($app->getLoggedInUserNickname())) {
+ 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'));
}
$customHome = $homeFilePath;
if (file_exists($cssFilePath)) {
- DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/home.css' . '" media="all" />';
+ DI::page()->registerStylesheet('home.css', 'all');
}
}