2017-01-15 19:09:57 +00:00
|
|
|
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
|
|
|
|
|
|
|
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
|
|
|
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
|
|
|
{{-- in the Software without restriction, including without limitation the rights --}}
|
|
|
|
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
|
|
|
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
|
|
|
{{-- furnished to do so, subject to the following conditions: --}}
|
|
|
|
|
|
|
|
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
|
|
|
{{-- copies or substantial portions of the Software. --}}
|
|
|
|
|
|
|
|
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
|
|
|
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
|
|
|
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
|
|
|
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
|
|
|
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
|
|
|
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
|
|
|
{{-- SOFTWARE. --}}
|
|
|
|
@extends('layouts.master')
|
|
|
|
|
|
|
|
@section('title')
|
2017-01-18 01:01:26 +00:00
|
|
|
@lang('base.security.header')
|
2017-01-15 19:09:57 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content-header')
|
2017-01-18 01:01:26 +00:00
|
|
|
<h1>@lang('base.security.header')<small>@lang('base.security.header_sub')</small></h1>
|
2017-01-15 19:09:57 +00:00
|
|
|
<ol class="breadcrumb">
|
2017-01-18 01:01:26 +00:00
|
|
|
<li><a href="{{ route('index') }}">@lang('strings.home')</a></li>
|
|
|
|
<li><a href="{{ route('account') }}">@lang('strings.account')</a></li>
|
|
|
|
<li class="active">@lang('strings.security')</li>
|
2017-01-15 19:09:57 +00:00
|
|
|
</ol>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
2017-01-18 01:01:26 +00:00
|
|
|
<h3 class="box-title">@lang('base.security.sessions')</h3>
|
2017-01-15 19:09:57 +00:00
|
|
|
</div>
|
|
|
|
<div class="box-body table-responsive no-padding">
|
|
|
|
<table class="table table-hover">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
2017-01-18 01:01:26 +00:00
|
|
|
<th>@lang('strings.id')</th>
|
|
|
|
<th>@lang('strings.ip')</th>
|
|
|
|
<th>@lang('strings.last_activity')</th>
|
2017-01-15 19:09:57 +00:00
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
@foreach($sessions as $session)
|
|
|
|
<tr>
|
|
|
|
<td><code>{{ substr($session->id, 0, 6) }}</code></td>
|
|
|
|
<td>{{ $session->ip_address }}</td>
|
|
|
|
<td>{{ Carbon::createFromTimestamp($session->last_activity)->diffForHumans() }}</td>
|
|
|
|
<td>
|
|
|
|
<a href="{{ route('account.security.revoke', $session->id) }}">
|
2017-01-18 01:01:26 +00:00
|
|
|
<button class="btn btn-xs btn-danger"><i class="fa fa-trash-o"></i> @lang('strings.revoke')</button>
|
2017-01-15 19:09:57 +00:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="box {{ (Auth::user()->use_totp) ? 'box-success' : 'box-danger' }}">
|
|
|
|
<div class="box-header with-border">
|
2017-01-18 01:01:26 +00:00
|
|
|
<h3 class="box-title">@lang('base.security.2fa_header')</h3>
|
2017-01-15 19:09:57 +00:00
|
|
|
</div>
|
|
|
|
@if(Auth::user()->use_totp)
|
|
|
|
<form action="{{ route('account.security.totp') }}" method="post">
|
|
|
|
<div class="box-body">
|
2017-01-18 01:01:26 +00:00
|
|
|
<p>@lang('base.security.2fa_enabled')</p>
|
2017-01-15 19:09:57 +00:00
|
|
|
<div class="form-group">
|
2017-01-18 01:01:26 +00:00
|
|
|
<label for="new_password_again" class="control-label">@lang('strings.2fa_token')</label>
|
2017-01-15 19:09:57 +00:00
|
|
|
<div>
|
|
|
|
<input type="text" class="form-control" name="token" />
|
2017-01-18 01:01:26 +00:00
|
|
|
<p class="text-muted small">@lang('base.security.2fa_token_help')</p>
|
2017-01-15 19:09:57 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-footer">
|
|
|
|
{!! csrf_field() !!}
|
|
|
|
{{ method_field('DELETE') }}
|
2017-01-18 01:01:26 +00:00
|
|
|
<button type="submit" class="btn btn-danger btn-sm">@lang('base.security.disable_2fa')</button>
|
2017-01-15 19:09:57 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
@else
|
|
|
|
<form action="#" method="post" id="do_2fa">
|
|
|
|
<div class="box-body">
|
2017-01-18 01:01:26 +00:00
|
|
|
@lang('base.security.2fa_disabled')
|
2017-01-15 19:09:57 +00:00
|
|
|
</div>
|
|
|
|
<div class="box-footer">
|
|
|
|
{!! csrf_field() !!}
|
2017-01-18 01:01:26 +00:00
|
|
|
<button type="submit" class="btn btn-success btn-sm">@lang('base.security.enable_2fa')</button>
|
2017-01-15 19:09:57 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal fade" id="open2fa" tabindex="-1" role="dialog" aria-labelledby="open2fa" aria-hidden="true">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<form action="#" method="post" id="2fa_token_verify">
|
|
|
|
<div class="modal-header">
|
2017-01-18 01:01:26 +00:00
|
|
|
<h4 class="modal-title">@lang('base.security.2fa_qr')</h4>
|
2017-01-15 19:09:57 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-body" id="modal_insert_content">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12" id="notice_box_2fa" style="display:none;"></div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<center><span id="hide_img_load"><i class="fa fa-spinner fa-spin"></i> Loading QR Code...</span><img src="" id="qr_image_insert" style="display:none;"/><br /><code id="2fa_secret_insert"></code></center>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
2017-01-18 01:01:26 +00:00
|
|
|
<div class="alert alert-info">@lang('base.security.2fa_checkpoint_help')</div>
|
2017-01-15 19:09:57 +00:00
|
|
|
<div class="form-group">
|
2017-01-18 01:01:26 +00:00
|
|
|
<label class="control-label" for="2fa_token">@lang('strings.2fa_token')</label>
|
2017-01-15 19:09:57 +00:00
|
|
|
{!! csrf_field() !!}
|
|
|
|
<input class="form-control" type="text" name="2fa_token" id="2fa_token" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2017-01-18 01:01:26 +00:00
|
|
|
<button type="submit" class="btn btn-primary btn-sm" id="submit_action">@lang('strings.submit')</button>
|
|
|
|
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal" id="close_reload">@lang('strings.close')</button>
|
2017-01-15 19:09:57 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('footer-scripts')
|
|
|
|
@parent
|
|
|
|
{!! Theme::js('js/frontend/2fa-modal.js') !!}
|
|
|
|
@endsection
|