From 94ea9c37d0c7108247559a1bccfd7bd688631b92 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 17 Feb 2021 21:11:23 -0800 Subject: [PATCH] Don't require auto-allocation settings if not enabled; closes #3085 --- .../Settings/AdvancedSettingsFormRequest.php | 15 +++++++++++++-- resources/views/admin/settings/advanced.blade.php | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Http/Requests/Admin/Settings/AdvancedSettingsFormRequest.php b/app/Http/Requests/Admin/Settings/AdvancedSettingsFormRequest.php index e69bd9ba6..c53825ffe 100644 --- a/app/Http/Requests/Admin/Settings/AdvancedSettingsFormRequest.php +++ b/app/Http/Requests/Admin/Settings/AdvancedSettingsFormRequest.php @@ -20,8 +20,19 @@ class AdvancedSettingsFormRequest extends AdminFormRequest 'pterodactyl:guzzle:timeout' => 'required|integer|between:1,60', 'pterodactyl:guzzle:connect_timeout' => 'required|integer|between:1,60', 'pterodactyl:client_features:allocations:enabled' => 'required|in:true,false', - 'pterodactyl:client_features:allocations:range_start' => 'required|integer|between:1024,65535', - 'pterodactyl:client_features:allocations:range_end' => 'required|integer|between:1024,65535', + 'pterodactyl:client_features:allocations:range_start' => [ + 'nullable', + 'required_if:pterodactyl:client_features:allocations:enabled,true', + 'integer', + 'between:1024,65535', + ], + 'pterodactyl:client_features:allocations:range_end' => [ + 'nullable', + 'required_if:pterodactyl:client_features:allocations:enabled,true', + 'integer', + 'between:1024,65535', + 'gt:pterodactyl:client_features:allocations:range_start', + ], ]; } diff --git a/resources/views/admin/settings/advanced.blade.php b/resources/views/admin/settings/advanced.blade.php index 3e92e7761..0f2056ca4 100644 --- a/resources/views/admin/settings/advanced.blade.php +++ b/resources/views/admin/settings/advanced.blade.php @@ -101,14 +101,14 @@
- +

The starting port in the range that can be automatically allocated.

- +

The ending port in the range that can be automatically allocated.