175 lines
11 KiB
PHP
175 lines
11 KiB
PHP
|
@extends('layouts.panel')
|
||
|
|
||
|
@section('page', 'Security')
|
||
|
|
||
|
@section('navigation')
|
||
|
<li class="active treeview menu-open">
|
||
|
<a>
|
||
|
<i class="fas fa-user"></i> <span>Account</span>
|
||
|
<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
|
||
|
</a>
|
||
|
<ul class="treeview-menu">
|
||
|
<li><a href="{{ route('panel.profile') }}"><i class="fas fa-id-badge"></i> Profile</a></li>
|
||
|
<li><a href="{{ route('panel.change') }}"><i class="fas fa-clipboard"></i> Change</a></li>
|
||
|
<li class="active"><a><i class="fas fa-lock"></i> Security</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li class="header">NAVIGATION</li>
|
||
|
<li>
|
||
|
<a href="{{ route('panel.home') }}"><i class="fas fa-tachometer-alt"></i> <span>Dashboard</span></a>
|
||
|
</li>
|
||
|
@canany(['project_see', 'status_see'])
|
||
|
<li class="treeview">
|
||
|
<a>
|
||
|
<i class="fas fa-list"></i> <span>Projects</span>
|
||
|
<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
|
||
|
</a>
|
||
|
<ul class="treeview-menu">
|
||
|
@can('project_see')<li><a href="{{ route('panel.project') }}"><i class="fas fa-clipboard"></i> Project</a></li>@endcan
|
||
|
@can('order_see')<li><a href="{{ route('panel.order') }}"><i class="fas fa-file-invoice"></i> Order</a></li>@endcan
|
||
|
@can('status_see')<li><a href="{{ route('panel.status') }}"><i class="fas fa-clipboard"></i> Status</a></li>@endcan
|
||
|
</ul>
|
||
|
</li>
|
||
|
@endcanany
|
||
|
@canany(['roles_see', 'user_see'])
|
||
|
<li class="treeview">
|
||
|
<a>
|
||
|
<i class="fas fa-user"></i> <span>Management</span>
|
||
|
<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
|
||
|
</a>
|
||
|
<ul class="treeview-menu">
|
||
|
@can('user_see')<li><a href="{{ route('panel.ums') }}"><i class="fas fa-id-badge"></i> Users</a></li>@endcan
|
||
|
@can('roles_see')<li><a href="{{ route('panel.role') }}"><i class="fas fa-lock"></i> Roles</a></li>@endcan
|
||
|
</ul>
|
||
|
</li>
|
||
|
@endcanany
|
||
|
@endsection
|
||
|
|
||
|
@section('content')
|
||
|
<div class="row">
|
||
|
<div class="col-xs-12 col-md-4 hidden-xs">
|
||
|
<div class="box box-primary">
|
||
|
<div class="box-header with-border">
|
||
|
<h3 class="box-title">Two-Factor Authentication</h3>
|
||
|
</div>
|
||
|
<div class="box-body">
|
||
|
@if($TFA)
|
||
|
<form method="POST" action="{{ route('2fa.toggle') }}" class="col-xs-10 col-xs-offset-1">
|
||
|
@csrf
|
||
|
|
||
|
@if(session('success'))
|
||
|
<div class="alert alert-success" role="alert">
|
||
|
{{ session('success') }}
|
||
|
<a class="close" data-dismiss="alert" aria-label="close">×</a>
|
||
|
</div>
|
||
|
|
||
|
@endif
|
||
|
<div class="form-group @error('two_factor') has-error @enderror">
|
||
|
<label for="two_factor" class="text-md-right">{{ __('2FA Code:') }}</label>
|
||
|
|
||
|
<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>
|
||
|
|
||
|
<button type="submit" class="btn btn-block btn-primary">{{ __('Disable 2FA') }}</button>
|
||
|
</form>
|
||
|
@else
|
||
|
<form method="POST" action="{{ route('2fa.toggle') }}" class="col-xs-10 col-xs-offset-1">
|
||
|
@csrf
|
||
|
|
||
|
@if(session('success'))
|
||
|
<div class="alert alert-success" role="alert">
|
||
|
{{ session('success') }}
|
||
|
<a class="close" data-dismiss="alert" aria-label="close">×</a>
|
||
|
</div>
|
||
|
|
||
|
@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>
|
||
|
|
||
|
<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>
|
||
|
|
||
|
<button type="submit" class="btn btn-block btn-primary">{{ __('Enable 2FA') }}</button>
|
||
|
</form>
|
||
|
@endif
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="col-xs-12 col-md-8">
|
||
|
<div class="box box-primary">
|
||
|
<div class="box-header">
|
||
|
<h3 class="box-title">Sessions</h3>
|
||
|
</div>
|
||
|
<div class="box-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> @if(filter_var(Request::ip(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) ••••:••••:••••:••••:••••:••••:••••:••••@else •••.•••.•••.••• @endif</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> @if(filter_var($session->ip_address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) ••••:••••:••••:••••:••••:••••:••••:••••@else •••.•••.•••.••• @endif</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>
|
||
|
<td><a href="{{ route('panel.session.delete', ['id' => $session->id]) }}" class="btn btn-primary btn-block"><span class="glyphicon glyphicon-trash"></span></a></td>
|
||
|
</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>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
@endsection
|