Enable packet passwords to be optional, configured by the admin in setup
This commit is contained in:
@@ -224,6 +224,7 @@ class HomeController extends Controller
|
||||
|
||||
$options->put('options',collect($request->post('options'))->sum());
|
||||
$options->put('msgs_pkt',$request->post('msgs_pkt'));
|
||||
$options->put('pkt_passwds',$request->post('pkt_passwds') === "1");
|
||||
|
||||
$o->servers = $servers;
|
||||
$o->options = $options;
|
||||
|
@@ -27,7 +27,7 @@ class SystemSessionRequest extends FormRequest
|
||||
return [
|
||||
'zone_id' => 'required|exists:zones,id',
|
||||
'sespass' => 'required|string|min:4',
|
||||
'pktpass' => 'required|string|min:4|max:8',
|
||||
'pktpass' => [$this->route('o')->pkt_passwds ? 'required' : 'nullable','string','min:4','max:8'],
|
||||
'ticpass' => 'required|string|min:4',
|
||||
'fixpass' => 'required|string|min:4',
|
||||
];
|
||||
|
@@ -75,6 +75,9 @@ class Setup extends Model
|
||||
case 'msgs_pkt':
|
||||
return Arr::get($this->options,$key,self::MAX_MSGS_PKT);
|
||||
|
||||
case 'pkt_passwds':
|
||||
return Arr::get($this->options,$key,TRUE);
|
||||
|
||||
default:
|
||||
return parent::__get($key);
|
||||
}
|
||||
|
@@ -190,6 +190,11 @@ class System extends Model
|
||||
return $val ?: Setup::findOrFail(config('app.id'))->batch_files;
|
||||
}
|
||||
|
||||
public function getPktPasswdsAttribute(?int $val): bool
|
||||
{
|
||||
return $val ?: Setup::findOrFail(config('app.id'))->pkt_passwds;
|
||||
}
|
||||
|
||||
public function getIsOwnedAttribute(): bool
|
||||
{
|
||||
return $this->users->count();
|
||||
|
Reference in New Issue
Block a user