Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
55cbe4087c |
@@ -45,7 +45,7 @@
|
||||
<!-- Top Menu Items -->
|
||||
@include('adminlte::layouts.partials.topmenu')
|
||||
|
||||
<li class="dropdown user user-menu @if($user->switched()) bg-red @endif" id="user_menu">
|
||||
<li class="dropdown user user-menu @if($user->switched) bg-red @endif" id="user_menu">
|
||||
<!-- Menu Toggle Button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<!-- The user image in the navbar-->
|
||||
@@ -69,7 +69,7 @@
|
||||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
@if ($user->switched())
|
||||
@if ($user->switched)
|
||||
<a href="{{ url('/admin/switch/stop') }}" class="btn btn-default btn-flat" id="switch">
|
||||
{{ trans('adminlte_lang::message.switchoff') }}
|
||||
</a>
|
||||
@@ -101,4 +101,4 @@
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
</header>
|
@@ -18,7 +18,7 @@ class AdminController extends Controller
|
||||
|
||||
public function switch_authorised()
|
||||
{
|
||||
return TRUE;
|
||||
return Auth::user()->isAdmin ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
public function switch_session()
|
||||
|
@@ -9,7 +9,12 @@ use Session;
|
||||
|
||||
trait UserSwitch
|
||||
{
|
||||
public function switched()
|
||||
public function GetIsAdminAttribute()
|
||||
{
|
||||
return isset($this->admin) ? $this->admin : FALSE;
|
||||
}
|
||||
|
||||
public function getSwitchedAttribute()
|
||||
{
|
||||
return Session::get('orig_user');
|
||||
}
|
||||
|
Reference in New Issue
Block a user