From 52961e2403bd303378a8dfbfcf1bcf7a13e6e371 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 29 Jan 2025 21:15:55 +1100 Subject: [PATCH] Allow admins to reduce the size of pkt_msgs --- app/Http/Requests/SystemRegisterRequest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Requests/SystemRegisterRequest.php b/app/Http/Requests/SystemRegisterRequest.php index 6547015..5544e0f 100644 --- a/app/Http/Requests/SystemRegisterRequest.php +++ b/app/Http/Requests/SystemRegisterRequest.php @@ -37,7 +37,7 @@ class SystemRegisterRequest extends FormRequest 'heartbeat' => 'Sorry, only an admin can set this below 12', 'hold' => 'Must be Yes or No', 'pollmode' => 'Must be Hold, Normal or Crash', - 'pkt_msgs' => 'Sorry, only an admin can increase this above 100', + 'pkt_msgs' => 'Sorry, only an admin can increase this above 100 or below 5', ]; } @@ -95,10 +95,10 @@ class SystemRegisterRequest extends FormRequest 'nullable', 'integer', function ($attribute,$value,$fail) { - if (($value > 100) && (! Gate::allows('admin'))) + if ((($value > 100) || ($value < 5)) && (! Gate::allows('admin'))) $fail(true); }, - 'min:5', + 'min:1', 'max:65535', ], ] : []));