Save value instead of raw model to cache
This commit is contained in:
parent
2ec2a92645
commit
baddf3fc76
|
@ -30,6 +30,7 @@ class Options
|
|||
public function getOption(string $option): string
|
||||
{
|
||||
$value = Cache::get($option);
|
||||
|
||||
|
||||
if (is_null($value)) {
|
||||
Log::debug('Option '.$option.'not found in cache, refreshing from database');
|
||||
|
@ -37,7 +38,7 @@ class Options
|
|||
if (is_null($value)) {
|
||||
throw new \Exception('This option does not exist.');
|
||||
}
|
||||
Cache::put($option, $value);
|
||||
Cache::put($option, $value->option_value);
|
||||
Cache::put($option.'_desc', 'Undefined description');
|
||||
|
||||
return $value->option_value;
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<div class="col">
|
||||
|
||||
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||
<i class="fas fa-info-circle"></i> <b>Available security policies</b>
|
||||
<i class="fas fa-info-circle"></i> <b>Available security policies</b> (current policy: {{ $security['secPolicy'] }})
|
||||
|
||||
<p><b>Disabled:</b> No security policy will be enforced. This is insecure.</p>
|
||||
|
||||
|
@ -166,7 +166,7 @@
|
|||
<div class="form-group">
|
||||
<label for="pwExpiry">Password Expiry Control</label>
|
||||
<input type="text" class="form-control" id="pwExpiry" placeholder="time in days" name="pwExpiry" value="{{ $security['pwExpiry'] }}">
|
||||
<p class="text-muted text-sm"><i class="fas fa-info-circle"></i> Leave this field blank to disable. Users will be forced to reset their password after the specified time.</p>
|
||||
<p class="text-muted text-sm"><i class="fas fa-info-circle"></i> Leave this field zeroed to disable. Users will be forced to reset their password after the specified time.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue