Support alternative home sites
This commit is contained in:
parent
cd2f78924b
commit
afa4506e11
|
@ -69,6 +69,10 @@ return [
|
||||||
// Rewrite URLs with mod_rewrite
|
// Rewrite URLs with mod_rewrite
|
||||||
'rewrite_urls' => true,
|
'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
|
// Number of News shown on one site
|
||||||
'display_news' => 6,
|
'display_news' => 6,
|
||||||
|
|
||||||
|
|
|
@ -414,7 +414,7 @@ function guest_login()
|
||||||
$session->set('uid', $login_user->id);
|
$session->set('uid', $login_user->id);
|
||||||
$session->set('locale', $login_user->settings->language);
|
$session->set('locale', $login_user->settings->language);
|
||||||
|
|
||||||
redirect(page_link_to('news'));
|
redirect(page_link_to(config('home_site')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,10 @@ function load_days()
|
||||||
|
|
||||||
if (empty($days)) {
|
if (empty($days)) {
|
||||||
error(__('The administration has not configured any shifts yet.'));
|
error(__('The administration has not configured any shifts yet.'));
|
||||||
redirect(page_link_to('/'));
|
// Do not try to redirect to the current page
|
||||||
|
if (config('home_site') != 'user_shifts') {
|
||||||
|
redirect(page_link_to('/'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $days;
|
return $days;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ class LegacyMiddleware implements MiddlewareInterface
|
||||||
$page = str_replace('-', '_', $page);
|
$page = str_replace('-', '_', $page);
|
||||||
}
|
}
|
||||||
if ($page == '/') {
|
if ($page == '/') {
|
||||||
$page = $this->auth->user() ? 'news' : 'login';
|
$page = $this->auth->user() ? config('home_site') : 'login';
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = $content = '';
|
$title = $content = '';
|
||||||
|
|
Loading…
Reference in New Issue