mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-02 22:17:48 +09:00
fix settings edit not working
This commit is contained in:
@@ -13,6 +13,7 @@ class SettingsController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->middleware('allowed');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,7 +21,6 @@ class SettingsController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
User::checkAuthOrLogin();
|
|
||||||
$settings = SettingGroup::with([
|
$settings = SettingGroup::with([
|
||||||
'settings',
|
'settings',
|
||||||
])->orderBy('order', 'ASC')->get();
|
])->orderBy('order', 'ASC')->get();
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ class CheckAllowed
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($route == 'dash') {
|
if($route == 'dash') {
|
||||||
|
//print_r(User::all());
|
||||||
|
//die("here".var_dump($current_user->password));
|
||||||
if((bool)$current_user->public_front === true) return $next($request);
|
if((bool)$current_user->public_front === true) return $next($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,8 +88,12 @@ class Setting extends Model
|
|||||||
|
|
||||||
public function getEditValueAttribute()
|
public function getEditValueAttribute()
|
||||||
{
|
{
|
||||||
$user = $this->user();
|
if((bool)$this->system === true) {
|
||||||
$this->value = $this->users()->where('id', $user->id)->first()->pivot->value;
|
$value = self::_fetch($this->key);
|
||||||
|
} else {
|
||||||
|
$value = self::fetch($this->key);
|
||||||
|
}
|
||||||
|
$this->value = $value;
|
||||||
switch($this->type) {
|
switch($this->type) {
|
||||||
case 'image':
|
case 'image':
|
||||||
$value = '';
|
$value = '';
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
<a href="{{ route('user.select') }}">Switch User</a>
|
<a style="background: rgba(0,0,0,0.6); position: absolute; padding: 5px; color: white; text-align: center; top:0; left: 0; right: 0;" href="{{ route('user.select') }}">Switch User</a>
|
||||||
@yield('content')
|
@yield('content')
|
||||||
<div id="config-buttons">
|
<div id="config-buttons">
|
||||||
|
|
||||||
@@ -81,7 +81,9 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
<a id="dash" class="config" href="{{ route('dash', [], false) }}"><i class="fas fa-th"></i></a>
|
<a id="dash" class="config" href="{{ route('dash', [], false) }}"><i class="fas fa-th"></i></a>
|
||||||
|
@if(App\User::currentUser()->id === 1)
|
||||||
<a id="users" class="config" href="{{ route('users.index', [], false) }}"><i class="fas fa-user"></i></a>
|
<a id="users" class="config" href="{{ route('users.index', [], false) }}"><i class="fas fa-user"></i></a>
|
||||||
|
@endif
|
||||||
<a id="items" class="config" href="{{ route('items.index', [], false) }}"><i class="fas fa-list"></i></a>
|
<a id="items" class="config" href="{{ route('items.index', [], false) }}"><i class="fas fa-list"></i></a>
|
||||||
<a id="folder" class="config" href="{{ route('tags.index', [], false) }}"><i class="fas fa-tag"></i></a>
|
<a id="folder" class="config" href="{{ route('tags.index', [], false) }}"><i class="fas fa-tag"></i></a>
|
||||||
<a id="settings" class="config" href="{{ route('settings.index', [], false) }}"><i class="fas fa-cogs"></i></a>
|
<a id="settings" class="config" href="{{ route('settings.index', [], false) }}"><i class="fas fa-cogs"></i></a>
|
||||||
|
|||||||
Reference in New Issue
Block a user