2021-06-27 19:01:43 +00:00
|
|
|
@extends('layouts.profile')
|
2020-02-26 13:59:58 +00:00
|
|
|
|
2020-02-26 23:42:36 +00:00
|
|
|
@section('css')
|
|
|
|
<link href="{{ asset('assets/css/font-awesome.min.css') }}" rel="stylesheet">
|
|
|
|
@endsection
|
2020-02-26 13:59:58 +00:00
|
|
|
|
|
|
|
@section('content')
|
2020-02-26 23:42:36 +00:00
|
|
|
<div class="container-fluid" style="margin-top: 75px">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12 col-md-4 hidden-xs">
|
|
|
|
<div class="panel panel-theme">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">Two-Factor Authentication</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
@if($TFA)
|
|
|
|
<form method="POST" action="{{ route('2fa.toggle') }}" class="col-xs-10 col-xs-offset-1">
|
|
|
|
@csrf
|
2020-02-26 13:59:58 +00:00
|
|
|
|
2020-02-26 23:42:36 +00:00
|
|
|
@if(session('success'))
|
|
|
|
<div class="alert alert-success" role="alert">
|
|
|
|
{{ session('success') }}
|
|
|
|
<a class="close" data-dismiss="alert" aria-label="close">×</a>
|
|
|
|
</div>
|
2020-02-26 13:59:58 +00:00
|
|
|
|
2020-02-26 23:42:36 +00:00
|
|
|
@endif
|
|
|
|
<div class="form-group @error('two_factor') has-error @enderror">
|
|
|
|
<label for="two_factor" class="text-md-right">{{ __('2FA Code:') }}</label>
|
2020-02-26 13:59:58 +00:00
|
|
|
|
2020-02-26 23:42:36 +00:00
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
|
|
|
|
<input id="two_factor" type="text" maxlength="6" class="form-control" name="two_factor" required autocomplete="off" autofocus>
|
|
|
|
</div>
|
|
|
|
@error('two_factor')
|
|
|
|
<span class="help-block">{{ $message }}</span>
|
|
|
|
@enderror
|
|
|
|
</div>
|
2020-02-26 13:59:58 +00:00
|
|
|
|
2020-02-26 23:42:36 +00:00
|
|
|
<button type="submit" class="btn btn-custom" style="width: 100%">{{ __('Disable 2FA') }}</button>
|
|
|
|
</form>
|
|
|
|
@else
|
|
|
|
<form method="POST" action="{{ route('2fa.toggle') }}" class="col-xs-10 col-xs-offset-1">
|
|
|
|
@csrf
|
2020-02-26 13:59:58 +00:00
|
|
|
|
2020-02-26 23:42:36 +00:00
|
|
|
@if(session('success'))
|
|
|
|
<div class="alert alert-success" role="alert">
|
|
|
|
{{ session('success') }}
|
|
|
|
<a class="close" data-dismiss="alert" aria-label="close">×</a>
|
|
|
|
</div>
|
2020-02-26 13:59:58 +00:00
|
|
|
|
2020-02-26 23:42:36 +00:00
|
|
|
@endif
|
|
|
|
<div class="text-center">
|
|
|
|
<img src="{{ $QRCode }}" style="max-width: 250px; max-height: 250px; width: 100%; height: auto">
|
|
|
|
</div>
|
|
|
|
<div class="form-group @error('two_factor') has-error @enderror">
|
|
|
|
<label for="two_factor" class="text-md-right">{{ __('2FA Code:') }}</label>
|
2020-02-26 13:59:58 +00:00
|
|
|
|
2020-02-26 23:42:36 +00:00
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
|
|
|
|
<input id="two_factor" type="text" maxlength="6" class="form-control" name="two_factor" required autocomplete="off" autofocus>
|
|
|
|
</div>
|
|
|
|
@error('two_factor')
|
|
|
|
<span class="help-block">{{ $message }}</span>
|
|
|
|
@enderror
|
2020-02-26 13:59:58 +00:00
|
|
|
</div>
|
2020-02-26 23:42:36 +00:00
|
|
|
|
|
|
|
<button type="submit" class="btn btn-custom" style="width: 100%">{{ __('Enable 2FA') }}</button>
|
|
|
|
</form>
|
|
|
|
@endif
|
2020-02-26 13:59:58 +00:00
|
|
|
</div>
|
2020-02-26 23:42:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12 col-md-8">
|
|
|
|
<div class="panel panel-theme">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">Sessions</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<table class="table table-bordered table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="ip">IP</th>
|
|
|
|
<th class="hidden-xs hidden-sm hidden-md">Country</th>
|
|
|
|
<th class="hidden-xs hidden-sm hidden-md">Browser</th>
|
|
|
|
<th class="hidden-xs">Last Activity</th>
|
|
|
|
<th style="width: 50px" class="text-center">Action</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="ip">
|
|
|
|
<code><i class="fa fa-key"></i> {{ preg_replace('/([0-9a-zA-Z])/', '•', Request::ip()) }}</code>
|
|
|
|
<code class="hidden"><i class="fa fa-eye-slash"></i> {{ Request::ip() }}</code>
|
|
|
|
</td>
|
|
|
|
<td class="hidden-xs hidden-sm hidden-md">{{ geoip(Request::ip())['country'] }}</td>
|
|
|
|
<td class="hidden-xs hidden-sm hidden-md">{{ $agent->browser() }}</td>
|
|
|
|
<td class="hidden-xs">{{ date('H:i:s d-m-Y', time()) }}</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
@foreach($sessions as $session)
|
|
|
|
@php($agent->setUserAgent($session->user_agent))
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<code><i class="fa fa-key"></i> {{ preg_replace('/([0-9a-zA-Z])/', '•', $session->ip_address) }}</code>
|
|
|
|
<code class="hidden"><i class="fa fa-eye-slash"></i> {{ $session->ip_address }}</code>
|
|
|
|
</td>
|
|
|
|
<td class="hidden-xs hidden-sm hidden-md">{{ geoip($session->ip_address)['country'] }}</td>
|
|
|
|
<td class="hidden-xs hidden-sm hidden-md">{{ $agent->browser() }}</td>
|
|
|
|
<td class="hidden-xs">{{ date('H:i:s d-m-Y', $session->last_activity) }}</td>
|
2021-06-27 19:01:43 +00:00
|
|
|
<td><a href="{{ route('session.delete', ['id' => $session->id]) }}" class="btn btn-custom"><span class="glyphicon glyphicon-trash"></span></a></td>
|
2020-02-26 23:42:36 +00:00
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<nav style="float: right">
|
|
|
|
<ul class="pagination">
|
|
|
|
<li @if($page == 1) class="disabled" @endif>
|
|
|
|
<a @if($page != 1) href="{{ route('panel.account', ['page' => ($page - 1)]) }}" @endif aria-label="Previous"><span aria-hidden="true">«</span></a>
|
|
|
|
</li>
|
|
|
|
@for($i = 1; $i <= $pages; $i++)
|
|
|
|
<li @if($i == $page) class="active" @endif>
|
|
|
|
<a @if($i != $page)href="{{ route('panel.account', ['page' => $i]) }}" @endif><span>{{ $i }}</span></a>
|
|
|
|
</li>
|
|
|
|
@endfor
|
|
|
|
<li @if($page == $pages) class="disabled" @endif>
|
|
|
|
<a @if($page != $pages) href="{{ route('panel.account', ['page' => ($page + 1)]) }}" @endif aria-label="Next"><span aria-hidden="true">»</span></a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
2020-02-26 13:59:58 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-26 23:42:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('javascript')
|
|
|
|
<script src="{{ asset('assets/js/credential.js') }}"></script>
|
2020-02-26 13:59:58 +00:00
|
|
|
@endsection
|