Support disabling the arrival feature
Setting `autoarrive` to true will now cause all newly registered angels to be automatically confirmed as arrived.
This commit is contained in:
parent
afa4506e11
commit
69ac1b2d21
|
@ -82,6 +82,9 @@ return [
|
|||
// Only arrived angels can sign up for shifts
|
||||
'signup_requires_arrival' => false,
|
||||
|
||||
// Whether newly-registered user should automatically be marked as arrived
|
||||
'autoarrive' => false,
|
||||
|
||||
// Number of hours that an angel has to sign out own shifts
|
||||
'last_unsubscribe' => 3,
|
||||
|
||||
|
|
|
@ -217,7 +217,12 @@ function guest_register()
|
|||
->associate($user)
|
||||
->save();
|
||||
|
||||
(new State())->user()
|
||||
$state = new State([]);
|
||||
if (config('autoarrive')) {
|
||||
$state->arrived = true;
|
||||
$state->arrival_date = new Carbon();
|
||||
}
|
||||
$state->user()
|
||||
->associate($user)
|
||||
->save();
|
||||
|
||||
|
|
|
@ -114,6 +114,10 @@ function make_navigation()
|
|||
'admin_event_config' => __('Event config'),
|
||||
];
|
||||
|
||||
if (config('autoarrive')) {
|
||||
unset($admin_pages['admin_arrive']);
|
||||
}
|
||||
|
||||
foreach ($admin_pages as $menu_page => $title) {
|
||||
if (auth()->can($menu_page)) {
|
||||
$admin_menu[] = toolbar_item_link(
|
||||
|
|
Loading…
Reference in New Issue