Enable packet passwords to be optional, configured by the admin in setup
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 42s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m43s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
Deon George 2025-01-29 09:42:15 +11:00
parent 8cc561ea2b
commit c9eee48c6a
6 changed files with 33 additions and 11 deletions

View File

@ -224,6 +224,7 @@ class HomeController extends Controller
$options->put('options',collect($request->post('options'))->sum()); $options->put('options',collect($request->post('options'))->sum());
$options->put('msgs_pkt',$request->post('msgs_pkt')); $options->put('msgs_pkt',$request->post('msgs_pkt'));
$options->put('pkt_passwds',$request->post('pkt_passwds') === "1");
$o->servers = $servers; $o->servers = $servers;
$o->options = $options; $o->options = $options;

View File

@ -27,7 +27,7 @@ class SystemSessionRequest extends FormRequest
return [ return [
'zone_id' => 'required|exists:zones,id', 'zone_id' => 'required|exists:zones,id',
'sespass' => 'required|string|min:4', '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', 'ticpass' => 'required|string|min:4',
'fixpass' => 'required|string|min:4', 'fixpass' => 'required|string|min:4',
]; ];

View File

@ -75,6 +75,9 @@ class Setup extends Model
case 'msgs_pkt': case 'msgs_pkt':
return Arr::get($this->options,$key,self::MAX_MSGS_PKT); return Arr::get($this->options,$key,self::MAX_MSGS_PKT);
case 'pkt_passwds':
return Arr::get($this->options,$key,TRUE);
default: default:
return parent::__get($key); return parent::__get($key);
} }

View File

@ -190,6 +190,11 @@ class System extends Model
return $val ?: Setup::findOrFail(config('app.id'))->batch_files; 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 public function getIsOwnedAttribute(): bool
{ {
return $this->users->count(); return $this->users->count();

View File

@ -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> <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> <label class="form-check-label" for="binkp_nr">Non-Reliable Mode <sup>*</sup></label>
</div> </div>
<p class="pt-3"><sup>*</sup> Recommended Defaults</p>
</div> </div>
</div> </div>
</div> </div>
@ -238,19 +236,34 @@
<div class="row"> <div class="row">
<div class="col-6"> <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="form-group row pt-0">
<div class="col-2"> <div class="col-9">
<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) }}"> <label class="col-form-label pt-2" for="msgs_pkt">Max Messages per Packet</label>
</div> </div>
<div class="col-10"> <div class="col-3">
<label class="col-form-label pt-2" for="msgs_pkt">Max Messages per Packet</label> <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> </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="row pt-5">
<div class="col-2"> <div class="col-2">
<a href="{{ back()->getTargetUrl() }}" class="btn btn-danger">Cancel</a> <a href="{{ back()->getTargetUrl() }}" class="btn btn-danger">Cancel</a>

View File

@ -45,7 +45,7 @@
<label for="pktpass" class="form-label">Packet Password</label> <label for="pktpass" class="form-label">Packet Password</label>
<div class="input-group has-validation"> <div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-box"></i></span> <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"> <span class="invalid-feedback" role="alert">
@error('pktpass') @error('pktpass')
{{ $message }} {{ $message }}