From 35d4daa4f991dcfcfc0e353b4bc10664e8ba7e3d Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sat, 4 May 2019 16:26:32 +0200 Subject: [PATCH] Kept the hook, ditched the init --- src/Module/Home.php | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/Module/Home.php b/src/Module/Home.php index f58664f9d7..adcdb02a63 100644 --- a/src/Module/Home.php +++ b/src/Module/Home.php @@ -12,25 +12,6 @@ use Friendica\Core\Renderer; */ class Home extends BaseModule { - public static function init() - { - // currently no returned data is used - $ret = []; - - Hook::callAll('home_init', $ret); - - $app = self::getApp(); - $config = $app->getConfig(); - - if (local_user() && ($app->user['nickname'])) { - $app->internalRedirect('network'); - } - - if (strlen($config->get('system', 'singleuser'))) { - $app->internalRedirect('/profile/' . $config->get('system', 'singleuser')); - } - } - public static function content() { if (!empty($_SESSION['theme'])) { @@ -44,6 +25,19 @@ class Home extends BaseModule $app = self::getApp(); $config = $app->getConfig(); + // currently no returned data is used + $ret = []; + + Hook::callAll('home_init', $ret); + + if (local_user() && ($app->user['nickname'])) { + $app->internalRedirect('network'); + } + + if (strlen($config->get('system', 'singleuser'))) { + $app->internalRedirect('/profile/' . $config->get('system', 'singleuser')); + } + $customHome = ''; $defaultHeader = ($config->get('config', 'sitename') ? L10n::t('Welcome to %s', $config->get('config', 'sitename')) : '');