FEATURE #2047: use laravel's authorization

This commit is contained in:
Michal Kváček
2017-08-02 13:33:26 +02:00
parent 67fb3c6945
commit a4c020daa0
60 changed files with 1357 additions and 50 deletions
+64
View File
@@ -0,0 +1,64 @@
@extends('admin.layout')
@section('pageHeading', trans('admin/loginForm.login'))
@section('page')
<div class="auth">
<div class="auth-container">
<div class="card">
<header class="auth-header">
<h1 class="auth-title">
@lang('admin/loginForm.login')
</h1>
</header>
<div class="auth-content">
<p class="text-xs-center">@lang('admin/loginForm.loginToContinue')</p>
<form method="POST" action="{{ route('login') }}">
<input type="hidden" name="redirectTo" value="{{session('redirectTo')}}">
{!! csrf_field() !!}
<div class="form-group">
<label for="email">@lang('admin/loginForm.email')</label>
<input type="email"
class="form-control underlined"
name="email" id="email"
placeholder="@lang('admin/loginForm.yourEmail')"
required>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
<div class="form-group">
<label for="password">@lang('admin/loginForm.password')</label>
<input type="password"
class="form-control underlined"
name="password" id="password"
placeholder="@lang('admin/loginForm.yourPassword')"
required>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
<div class="form-group text-center">
<button type="submit" class="btn btn-block btn-primary">Login</button>
</div>
<div class="form-group text-center">
<a class="btn btn-link" href="{{ route('password.request') }}">
@lang('admin/loginForm.forgottenPassword')
</a>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,42 @@
@extends('admin.layout')
@section('pageHeading', trans('admin/loginForm.forgottenPassword'))
@section('page')
<div class="auth">
<div class="auth-container">
<div class="card">
<header class="auth-header">
<h1 class="auth-title">
@lang('admin/loginForm.forgottenPassword')
</h1>
</header>
<div class="auth-content">
<form class="form-horizontal" method="POST" action="{{ route('password.email') }}">
{!! csrf_field() !!}
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">@lang('register.email')</label>
<input id="email" type="email" class="form-control underlined" name="email"
value="{{ old('email') }}" required>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">
@lang('admin/loginForm.sendConfirmEmail')
</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,68 @@
@extends('admin.layout')
@section('pageHeading', trans('admin/loginForm.passwordReset'))
@section('page')
<div class="auth">
<div class="auth-container">
<div class="card">
<header class="auth-header">
<h1 class="auth-title">
@lang('admin/loginForm.passwordReset')
</h1>
</header>
<div class="auth-content">
<form class="form-horizontal" method="POST" action="{{ route('password.request') }}">
{!! csrf_field() !!}
<input type="hidden" name="token" value="{{ $token }}">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email">@lang('register.email')</label>
<input id="email" type="email" class="form-control underlined" name="email"
value="{{ $email or old('email') }}" required autofocus>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password">@lang('register.password')</label>
<input id="password" type="password" class="form-control underlined" name="password"
required>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<label for="password-confirm">@lang('register.passwordConfirm')</label>
<input id="password-confirm" type="password" class="form-control underlined"
name="password_confirmation" required>
@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">
@lang('register.setNewPassword')
</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection
+89
View File
@@ -0,0 +1,89 @@
@extends('admin.layout')
@section('pageHeading', trans('register.heading'))
@section('page')
<div class="auth">
<div class="auth-container">
<div class="card">
<header class="auth-header">
<h1 class="auth-title">
@lang('register.heading')
</h1>
</header>
<div class="auth-content">
<form class="form-horizontal" method="POST" action="{{ route('register') }}">
{!! csrf_field() !!}
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name">@lang('register.name')</label>
<input id="name" type="text" class="form-control underlined" name="name"
value="{{ old('name') }}" placeholder="@lang('register.name')"
required autofocus>
@if ($errors->has('name'))
<span class="help-block">
<strong>{{ $errors->first('name') }}</strong>
</span>
@endif
</div>
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email">@lang('register.email')</label>
<input id="email" type="email" class="form-control underlined" name="email"
placeholder="@lang('admin/loginForm.yourEmail')"
value="{{ old('email') }}" required>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password">@lang('register.password')</label>
<input id="password" type="password" class="form-control underlined" name="password"
required>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
<div class="form-group">
<label for="password-confirm">@lang('register.passwordConfirm')</label>
<input id="password-confirm" type="password" class="form-control underlined"
name="password_confirmation" required>
</div>
<div class="form-group">
{!! \Greggilbert\Recaptcha\Facades\Recaptcha::render() !!}
@if ($errors->has('g-recaptcha-response'))
<span class="help-block">
<strong>{{ $errors->first('g-recaptcha-response') }}</strong>
</span>
@endif
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">
@lang('register.register')
</button>
</div>
<div class="clearfix"></div>
</form>
</div>
</div>
</div>
</div>
@endsection