4 use Friendica\Core\Config;
5 use Friendica\Core\System;
6 use Friendica\Module\Login;
8 if(! function_exists('home_init')) {
9 function home_init(App $a) {
12 call_hooks('home_init',$ret);
14 if (local_user() && ($a->user['nickname'])) {
15 goaway(System::baseUrl()."/network");
18 if (strlen(Config::get('system','singleuser'))) {
19 goaway(System::baseUrl()."/profile/" . Config::get('system','singleuser'));
24 if(! function_exists('home_content')) {
25 function home_content(App $a) {
29 if (x($_SESSION,'theme')) {
30 unset($_SESSION['theme']);
32 if (x($_SESSION,'mobile-theme')) {
33 unset($_SESSION['mobile-theme']);
36 /// @TODO No absolute path used, maybe risky (security)
37 if (file_exists('home.html')) {
38 if (file_exists('home.css')) {
39 $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.System::baseUrl().'/home.css'.'" media="all" />';
42 $o .= file_get_contents('home.html');
44 $o .= '<h1>'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'</h1>';
47 $o .= Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
50 call_hooks("home_content",$o);