Only admins can change the heartbeat below 12
This commit is contained in:
parent
7da09a1a9e
commit
967153c70a
@ -34,6 +34,7 @@ class SystemRegisterRequest extends FormRequest
|
|||||||
public function messages(): array
|
public function messages(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'heartbeat' => 'Sorry, only an admin can set this below 12',
|
||||||
'hold' => 'Must be Yes or No',
|
'hold' => 'Must be Yes or No',
|
||||||
'pollmode' => 'Must be Hold, Normal or Crash',
|
'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',
|
||||||
@ -75,14 +76,23 @@ class SystemRegisterRequest extends FormRequest
|
|||||||
'active' => 'required|boolean',
|
'active' => 'required|boolean',
|
||||||
'hold' => 'sometimes|boolean',
|
'hold' => 'sometimes|boolean',
|
||||||
'pollmode' => 'required|integer|min:0|max:2',
|
'pollmode' => 'required|integer|min:0|max:2',
|
||||||
'heartbeat' => 'nullable|integer|min:0|max:48',
|
'heartbeat' => [
|
||||||
|
'nullable',
|
||||||
|
'integer',
|
||||||
|
function ($attribute,$value,$fail) {
|
||||||
|
if (($value < 12) && (! Gate::allows('admin')))
|
||||||
|
$fail(true);
|
||||||
|
},
|
||||||
|
'min:0',
|
||||||
|
'max:48'
|
||||||
|
],
|
||||||
'pkt_msgs' => [
|
'pkt_msgs' => [
|
||||||
'nullable',
|
'nullable',
|
||||||
|
'integer',
|
||||||
function ($attribute,$value,$fail) {
|
function ($attribute,$value,$fail) {
|
||||||
if (($value > 100) && (! Gate::allows('admin')))
|
if (($value > 100) && (! Gate::allows('admin')))
|
||||||
$fail(true);
|
$fail(true);
|
||||||
},
|
},
|
||||||
'integer',
|
|
||||||
'min:5',
|
'min:5',
|
||||||
'max:65535',
|
'max:65535',
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user