Skip to content

Commit 94ea9c3

Browse files
committed
Don't require auto-allocation settings if not enabled; closes pterodactyl#3085
1 parent 2459899 commit 94ea9c3

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

app/Http/Requests/Admin/Settings/AdvancedSettingsFormRequest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,19 @@ public function rules()
2020
'pterodactyl:guzzle:timeout' => 'required|integer|between:1,60',
2121
'pterodactyl:guzzle:connect_timeout' => 'required|integer|between:1,60',
2222
'pterodactyl:client_features:allocations:enabled' => 'required|in:true,false',
23-
'pterodactyl:client_features:allocations:range_start' => 'required|integer|between:1024,65535',
24-
'pterodactyl:client_features:allocations:range_end' => 'required|integer|between:1024,65535',
23+
'pterodactyl:client_features:allocations:range_start' => [
24+
'nullable',
25+
'required_if:pterodactyl:client_features:allocations:enabled,true',
26+
'integer',
27+
'between:1024,65535',
28+
],
29+
'pterodactyl:client_features:allocations:range_end' => [
30+
'nullable',
31+
'required_if:pterodactyl:client_features:allocations:enabled,true',
32+
'integer',
33+
'between:1024,65535',
34+
'gt:pterodactyl:client_features:allocations:range_start',
35+
],
2536
];
2637
}
2738

resources/views/admin/settings/advanced.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@
101101
<div class="form-group col-md-4">
102102
<label class="control-label">Starting Port</label>
103103
<div>
104-
<input type="number" required class="form-control" name="pterodactyl:client_features:allocations:range_start" value="{{ old('pterodactyl:client_features:allocations:range_start', config('pterodactyl.client_features.allocations.range_start')) }}">
104+
<input type="number" class="form-control" name="pterodactyl:client_features:allocations:range_start" value="{{ old('pterodactyl:client_features:allocations:range_start', config('pterodactyl.client_features.allocations.range_start')) }}">
105105
<p class="text-muted small">The starting port in the range that can be automatically allocated.</p>
106106
</div>
107107
</div>
108108
<div class="form-group col-md-4">
109109
<label class="control-label">Ending Port</label>
110110
<div>
111-
<input type="number" required class="form-control" name="pterodactyl:client_features:allocations:range_end" value="{{ old('pterodactyl:client_features:allocations:range_end', config('pterodactyl.client_features.allocations.range_end')) }}">
111+
<input type="number" class="form-control" name="pterodactyl:client_features:allocations:range_end" value="{{ old('pterodactyl:client_features:allocations:range_end', config('pterodactyl.client_features.allocations.range_end')) }}">
112112
<p class="text-muted small">The ending port in the range that can be automatically allocated.</p>
113113
</div>
114114
</div>

0 commit comments

Comments
 (0)