diff --git a/app/Http/Controllers/Admin/SettingsController.php b/app/Http/Controllers/Admin/SettingsController.php index 3a5605983..ecef6bb65 100644 --- a/app/Http/Controllers/Admin/SettingsController.php +++ b/app/Http/Controllers/Admin/SettingsController.php @@ -40,6 +40,10 @@ public function update(Request $request) continue; } + if ($setting->type == 'bool' || $setting->type == 'boolean') { + $value = get_truth_state($value); + } + Log::info('Updating "'.$setting->id.'" from "'.$setting->value.'" to "'.$value.'"'); $setting->value = $value; $setting->save(); diff --git a/app/Repositories/SettingRepository.php b/app/Repositories/SettingRepository.php index 2607e362b..960cc9526 100644 --- a/app/Repositories/SettingRepository.php +++ b/app/Repositories/SettingRepository.php @@ -51,7 +51,7 @@ public function retrieve($key) case 'bool': case 'boolean': $value = $setting->value; - return $value === 'true' || $value === '1' || $value === 1 || $value === 'on'; + return $value === 'true' || $value === '1' || $value === 1; case 'date': return Carbon::parse($setting->value); case 'int': diff --git a/app/Services/UserService.php b/app/Services/UserService.php index a60b0f0db..f69b65c92 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -54,7 +54,7 @@ public function __construct( public function createPilot(User $user, array $groups = null) { // Determine if we want to auto accept - if (get_truth_state(setting('pilots.auto_accept', false)) === true) { + if (setting('pilots.auto_accept') === true) { $user->state = UserState::ACTIVE; } else { $user->state = UserState::PENDING;