Add active session management
This commit is contained in:
parent
8190f08b75
commit
e7436aab2b
5 changed files with 113 additions and 13 deletions
|
@ -19,7 +19,7 @@
|
|||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.master')
|
||||
|
||||
@section('title', 'Account TOTP Settings')
|
||||
@section('title', 'Account Security')
|
||||
|
||||
@section('sidebar-server')
|
||||
@endsection
|
||||
|
@ -34,7 +34,46 @@
|
|||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
<h3 style="margin-top:0;">{{ trans('base.account.totp_header') }} <small>@if (Auth::user()->use_totp === 1){{ trans('strings.enabled') }}@else{{ trans('strings.disabled') }}@endif</small></h3><hr />
|
||||
<h3 style="margin-top:0;">Active Sessions</h3><hr />
|
||||
<table class="table table-bordered table-hover" style="margin-bottom:0;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Session ID</th>
|
||||
<th>IP Address</th>
|
||||
<th>User Agent</th>
|
||||
<th>Last Location</th>
|
||||
<th>Last Activity</th>
|
||||
<th></th>
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($sessions as $session)
|
||||
<tr>
|
||||
<?php $prev = unserialize(base64_decode($session->payload)) ?>
|
||||
<td><code>{{ substr($session->id, 0, 8) }}</code></td>
|
||||
<td>{{ $session->ip_address }}</td>
|
||||
<td><small>{{ $session->user_agent }}</small></td>
|
||||
<td>
|
||||
@if(isset($prev['_previous']['url']))
|
||||
{{ str_replace(env('APP_URL'), '', $prev['_previous']['url']) }}
|
||||
@else
|
||||
<em>unknwon</em>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if((time() - $session->last_activity < 10))
|
||||
<em>just now</em>
|
||||
@else
|
||||
{{ date('D, M j \a\t H:i:s', $session->last_activity) }}
|
||||
@endif
|
||||
</td>
|
||||
<td><a href="{{ route('account.security.revoke', $session->id) }}"><i class="fa fa-trash-o"></i></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>{{ trans('base.account.totp_header') }} <small>@if (Auth::user()->use_totp === 1){{ trans('strings.enabled') }}@else{{ trans('strings.disabled') }}@endif</small></h3><hr />
|
||||
@if (Auth::user()->use_totp === 1)
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">{{ trans('base.account.totp_disable') }}</div>
|
||||
|
@ -112,7 +151,7 @@
|
|||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find('a[href=\'/account/totp\']').addClass('active');
|
||||
$('#sidebar_links').find('a[href=\'/account/security\']').addClass('active');
|
||||
|
||||
$('#close_reload').click(function () {
|
||||
location.reload();
|
|
@ -182,7 +182,7 @@
|
|||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ trans('pagination.sidebar.account_controls') }} <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/account">{{ trans('pagination.sidebar.account_settings') }}</a></li>
|
||||
<li><a href="/account/totp">{{ trans('pagination.sidebar.account_security') }}</a></li>
|
||||
<li><a href="/account/security">{{ trans('pagination.sidebar.account_security') }}</a></li>
|
||||
<li><a href="/index">{{ trans('pagination.sidebar.servers') }}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -239,7 +239,7 @@
|
|||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-heading"><strong>{{ trans('pagination.sidebar.account_controls') }}</strong></a>
|
||||
<a href="/account" class="list-group-item">{{ trans('pagination.sidebar.account_settings') }}</a>
|
||||
<a href="/account/totp" class="list-group-item">{{ trans('pagination.sidebar.account_security') }}</a>
|
||||
<a href="/account/security" class="list-group-item">{{ trans('pagination.sidebar.account_security') }}</a>
|
||||
<a href="/" class="list-group-item">{{ trans('pagination.sidebar.servers') }}</a>
|
||||
</div>
|
||||
@section('sidebar-server')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue