Enable packet passwords to be optional, configured by the admin in setup
This commit is contained in:
parent
8cc561ea2b
commit
c9eee48c6a
@ -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();
|
||||
|
@ -156,8 +156,6 @@
|
||||
<input class="form-check-input" type="checkbox" id="binkp_nr" name="binkp[nr]" value="{{ Binkp::F_NOREL }}" @if(old('binkp.nr',$o->optionGet(Binkp::F_NOREL,'binkp_options'))) checked @endif>
|
||||
<label class="form-check-label" for="binkp_nr">Non-Reliable Mode <sup>*</sup></label>
|
||||
</div>
|
||||
|
||||
<p class="pt-3"><sup>*</sup> Recommended Defaults</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -238,19 +236,34 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<h3>Echomail Settings</h3>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h3>Other Settings</h3>
|
||||
|
||||
<div class="form-group row pt-0">
|
||||
<div class="col-2">
|
||||
<input class="form-control text-end" type="text" id="msgs_pkt" name="msgs_pkt" value="{{ old('msgs_pkt',$o->msgs_pkt ?: Setup::MAX_MSGS_PKT) }}">
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<label class="col-form-label pt-2" for="msgs_pkt">Max Messages per Packet</label>
|
||||
<div class="form-group row pt-0">
|
||||
<div class="col-9">
|
||||
<label class="col-form-label pt-2" for="msgs_pkt">Max Messages per Packet</label>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<input class="form-control text-end @error('msgs_pkt')is-invalid @enderror" type="text" id="msgs_pkt" name="msgs_pkt" value="{{ old('msgs_pkt',$o->msgs_pkt ?: Setup::MAX_MSGS_PKT) }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-1 form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="pkt_passwds" name="pkt_passwds" value="1" @if(old('pkt_passwds',$o->pkt_passwds)) checked @endif>
|
||||
<label class="form-check-label" for="pkt_passwds">Force Packet Passwords <sup>*</sup></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="pt-3 float-end"><sup>*</sup> Recommended Defaults</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pt-5">
|
||||
<div class="col-2">
|
||||
<a href="{{ back()->getTargetUrl() }}" class="btn btn-danger">Cancel</a>
|
||||
|
@ -45,7 +45,7 @@
|
||||
<label for="pktpass" class="form-label">Packet Password</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text"><i class="bi bi-box"></i></span>
|
||||
<input type="text" style="width: 35%;" class="form-control @error('pktpass') is-invalid @enderror" id="pktpass" placeholder="Packet" name="pktpass" value="{{ old('pktpass') }}" required>
|
||||
<input type="text" style="width: 35%;" class="form-control @error('pktpass') is-invalid @enderror" id="pktpass" placeholder="Packet" name="pktpass" value="{{ old('pktpass') }}" @required($o->pkt_passwds)>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('pktpass')
|
||||
{{ $message }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user