4 use Friendica\Core\System;
6 if(! function_exists('home_init')) {
7 function home_init(App $a) {
10 call_hooks('home_init',$ret);
12 if (local_user() && ($a->user['nickname'])) {
13 goaway(System::baseUrl()."/network");
16 if (strlen(get_config('system','singleuser'))) {
17 goaway(System::baseUrl()."/profile/" . get_config('system','singleuser'));
22 if(! function_exists('home_content')) {
23 function home_content(App $a) {
27 if (x($_SESSION,'theme')) {
28 unset($_SESSION['theme']);
30 if (x($_SESSION,'mobile-theme')) {
31 unset($_SESSION['mobile-theme']);
34 /// @TODO No absolute path used, maybe risky (security)
35 if (file_exists('home.html')) {
36 if (file_exists('home.css')) {
37 $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.System::baseUrl().'/home.css'.'" media="all" />';
40 $o .= file_get_contents('home.html');
42 $o .= '<h1>'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'</h1>';
46 $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
48 call_hooks("home_content",$o);