1
0
Fork 0

Update security settings

This commit is contained in:
Daniel Supernault 2019-04-11 13:58:56 -06:00
parent 847e7b7fa4
commit 7d252ea91c
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
3 changed files with 6 additions and 11 deletions

View File

@ -20,19 +20,14 @@ trait SecuritySettings
public function security() public function security()
{ {
$sessions = DB::table('sessions') $user = Auth::user();
->whereUserId(Auth::id())
->limit(20)
->get();
$activity = AccountLog::whereUserId(Auth::id()) $activity = AccountLog::whereUserId($user->id)
->orderBy('created_at', 'desc') ->orderBy('created_at', 'desc')
->limit(20) ->limit(20)
->get(); ->get();
$user = Auth::user(); return view('settings.security', compact('activity', 'user'));
return view('settings.security', compact('sessions', 'activity', 'user'));
} }
public function securityTwoFactorSetup(Request $request) public function securityTwoFactorSetup(Request $request)

View File

@ -23,7 +23,7 @@
@endif @endif
</div> </div>
@include('settings.security.2fa.partial.log-panel') @include('settings.security.log-panel')
</section> </section>
@endsection @endsection

View File

@ -1,12 +1,12 @@
<div class="mb-4 pb-4"> <div class="mb-4 pb-4">
<h4 class="font-weight-bold">Account Log</h4> <h4 class="font-weight-bold">Account Log</h4>
<hr> <hr>
<ul class="list-group" style="max-height: 400px;overflow-y: scroll;"> <ul class="list-group border" style="max-height: 400px;overflow-y: auto;">
@if($activity->count() == 0) @if($activity->count() == 0)
<p class="alert alert-info font-weight-bold">No activity logs found!</p> <p class="alert alert-info font-weight-bold">No activity logs found!</p>
@endif @endif
@foreach($activity as $log) @foreach($activity as $log)
<li class="list-group-item"> <li class="list-group-item rounded-0 border-0">
<div class="media"> <div class="media">
<div class="media-body"> <div class="media-body">
<span class="my-0 font-weight-bold text-muted"> <span class="my-0 font-weight-bold text-muted">