Support alternative home sites

main
Janne Heß 6 years ago committed by msquare
parent cd2f78924b
commit afa4506e11

@ -69,6 +69,10 @@ return [
// Rewrite URLs with mod_rewrite
'rewrite_urls' => true,
// Redirect to this site after logging in or when pressing the top-left button
// Must be one of news, user_meetings, user_shifts, angeltypes, user_questions
'home_site' => 'news',
// Number of News shown on one site
'display_news' => 6,

@ -414,7 +414,7 @@ function guest_login()
$session->set('uid', $login_user->id);
$session->set('locale', $login_user->settings->language);
redirect(page_link_to('news'));
redirect(page_link_to(config('home_site')));
}
}

@ -118,8 +118,11 @@ function load_days()
if (empty($days)) {
error(__('The administration has not configured any shifts yet.'));
// Do not try to redirect to the current page
if (config('home_site') != 'user_shifts') {
redirect(page_link_to('/'));
}
}
return $days;
}

@ -71,7 +71,7 @@ class LegacyMiddleware implements MiddlewareInterface
$page = str_replace('-', '_', $page);
}
if ($page == '/') {
$page = $this->auth->user() ? 'news' : 'login';
$page = $this->auth->user() ? config('home_site') : 'login';
}
$title = $content = '';

Loading…
Cancel
Save