Skip to content

Commit

Permalink
Merge pull request #27 from ARCANESOFT/path-validation
Browse files Browse the repository at this point in the history
Updating the package
  • Loading branch information
arcanedev-maroc authored Mar 1, 2018
2 parents 6ce7ae0 + 8e4d265 commit b1305d9
Show file tree
Hide file tree
Showing 40 changed files with 279 additions and 282 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/_ide_helper.php
/composer.lock
/composer.phar
/phpunit.xml
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 2
runs: 3
php_code_sniffer:
enabled: true
config:
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sudo: false
php:
- 7.0
- 7.1
- 7.2
- nightly

matrix:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 ARCANEDEV <[email protected]> - Auth For ARCANESOFT
Copyright (c) 2015-2018 ARCANEDEV <[email protected]> - Auth For ARCANESOFT

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"license": "MIT",
"require": {
"php": ">=7.0",
"arcanedev/gravatar": "~2.0",
"arcanedev/gravatar": "~2.1.0",
"arcanedev/laravel-auth": "~4.0",
"arcanedev/laravel-impersonator": "~1.1",
"arcanesoft/core": "~2.6"
"arcanedev/laravel-impersonator": "~1.2.0",
"arcanesoft/core": "~2.7.0"
},
"require-dev": {
"orchestra/testbench": "~3.5.0",
Expand Down
2 changes: 1 addition & 1 deletion config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/

'database' => [
'connection' => config('database.default'),
'connection' => env('DB_CONNECTION'),

'prefix' => 'auth_'
],
Expand Down
13 changes: 6 additions & 7 deletions resources/views/admin/_partials/navigation/user-menu.blade.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php
/** @var Arcanesoft\Auth\Models\User $user */
$user = auth()->user();
/** @var Arcanesoft\Auth\Models\User $user */
$user = auth()->user();
?>
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
{{ Html::image($user->gravatar, $user->full_name, ['class' => 'user-image']) }}
{{ html()->image($user->gravatar, $user->full_name, ['class' => 'user-image']) }}
<span class="hidden-xs">{{ $user->full_name }}</span>
</a>
<ul class="dropdown-menu">
{{-- User image --}}
<li class="user-header">
{{ Html::image($user->gravatar, $user->full_name, ['class' => 'img-circle']) }}
{{ html()->image($user->gravatar, $user->full_name, ['class' => 'img-circle']) }}
<p>{{ $user->full_name }} <small>{{ $user->since_date }}</small></p>
</li>
{{-- Menu Body --}}
Expand Down Expand Up @@ -40,9 +40,8 @@
<a href="#" class="btn btn-default btn-flat" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
{{ trans('auth::generals.logout') }} <i class="fa fa-fw fa-sign-out"></i>
</a>
<form id="logout-form" action="{{ route('auth::logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
{{ form()->open(['route' => 'auth::logout', 'method' => 'POST', 'id' => 'logout-form', 'style' => 'display: none;']) }}
{{ form()->close() }}
</div>
</li>
</ul>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/admin/password-resets/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</div>
</div>
@if ($resets->hasPages())
<div class="box-footer clearfix">{!! $resets->render() !!}</div>
<div class="box-footer clearfix">{{ $resets->render() }}</div>
@endif
</div>
@endsection
Expand All @@ -70,7 +70,7 @@
@unless($resets->isEmpty())
<div id="clear-password-resets-modal" class="modal fade">
<div class="modal-dialog">
{{ Form::open(['route' => 'admin::auth.password-resets.clear', 'method' => 'DELETE', 'class' => 'form form-loading', 'id' => 'clear-password-resets-form', 'autocomplete' => 'off']) }}
{{ form()->open(['route' => 'admin::auth.password-resets.clear', 'method' => 'DELETE', 'class' => 'form form-loading', 'id' => 'clear-password-resets-form', 'autocomplete' => 'off']) }}
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
Expand All @@ -84,13 +84,13 @@
{{ ui_button('clear', 'submit')->withLoadingText() }}
</div>
</div>
{{ Form::close() }}
{{ form()->close() }}
</div>
</div>

<div id="delete-password-resets-modal" class="modal fade">
<div class="modal-dialog">
{{ Form::open(['route' => 'admin::auth.password-resets.delete', 'method' => 'DELETE', 'class' => 'form form-loading', 'id' => 'delete-password-resets-form', 'autocomplete' => 'off']) }}
{{ form()->open(['route' => 'admin::auth.password-resets.delete', 'method' => 'DELETE', 'class' => 'form form-loading', 'id' => 'delete-password-resets-form', 'autocomplete' => 'off']) }}
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
Expand All @@ -104,7 +104,7 @@
{{ ui_button('delete', 'submit')->withLoadingText() }}
</div>
</div>
{{ Form::close() }}
{{ form()->close() }}
</div>
</div>
@endunless
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php /** @var \Arcanesoft\Auth\Models\Permission $permission */ ?>

<div class="box box-default">
<div class="box-header">
<h3 class="box-title">{{ trans('auth::permission-groups.titles.permission-group') }}</h3>
Expand Down
7 changes: 4 additions & 3 deletions resources/views/admin/permissions/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php /** @var \Illuminate\Pagination\LengthAwarePaginator $permissions */ ?>

@section('header')
<h1><i class="fa fa-fw fa-check-circle"></i> {{ trans('auth::permissions.titles.permissions') }} <small>{{ trans('auth::permissions.titles.permissions-list') }}</small></h1>
@endsection
Expand Down Expand Up @@ -27,7 +28,7 @@
</thead>
<tbody>
@forelse($permissions as $permission)
<?php /** @var \Arcanesoft\Auth\Models\Permission $permission */ ?>
<?php /** @var Arcanesoft\Auth\Models\Permission $permission */ ?>
<tr>
<td>
@php($hasGroup = $permission->hasGroup())
Expand All @@ -40,7 +41,7 @@
</td>
<td>{{ $permission->name }}</td>
<td>{{ $permission->description }}</td>
<td class="text-center">{{ label_count($permission->roles->count()) }}</td>
<td class="text-center">{{ label_count($permission->roles_count) }}</td>
<td class="text-right">
@can(Arcanesoft\Auth\Policies\PermissionsPolicy::PERMISSION_SHOW)
{{ ui_link_icon('show', route('admin::auth.permissions.show', [$permission->hashed_id])) }}
Expand All @@ -60,7 +61,7 @@
</div>
@if ($permissions->hasPages())
<div class="box-footer clearfix">
{!! $permissions->render() !!}
{{ $permissions->render() }}
</div>
@endif
</div>
Expand Down
9 changes: 5 additions & 4 deletions resources/views/admin/permissions/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php /** @var \Arcanesoft\Auth\Models\Permission $permission */ ?>
<?php /** @var Arcanesoft\Auth\Models\Permission $permission */ ?>

@section('header')
<h1><i class="fa fa-fw fa-check-circle"></i> {{ trans('auth::permissions.titles.permissions') }} <small>{{ trans('auth::permissions.titles.permission-details') }}</small></h1>
@endsection
Expand Down Expand Up @@ -69,7 +70,7 @@
</thead>
<tbody>
@forelse ($permission->roles as $role)
<?php /** @var \Arcanesoft\Auth\Models\Role $role */ ?>
<?php /** @var Arcanesoft\Auth\Models\Role $role */ ?>
<tr>
<td>
<span class="label label-primary">{{ $role->name }}</span>
Expand Down Expand Up @@ -112,7 +113,7 @@
{{-- DETACH MODAL --}}
<div id="detach-role-modal" class="modal fade" data-backdrop="false" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
{{ Form::open(['method' => 'DELETE', 'id' => 'detach-role-form', 'class' => 'form form-loading', 'autocomplete' => 'off']) }}
{{ form()->open(['method' => 'DELETE', 'id' => 'detach-role-form', 'class' => 'form form-loading', 'autocomplete' => 'off']) }}
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
Expand All @@ -128,7 +129,7 @@
{{ ui_button('detach', 'submit')->withLoadingText() }}
</div>
</div>
{{ Form::close() }}
{{ form()->close() }}
</div>
</div>
@endcan
Expand Down
18 changes: 9 additions & 9 deletions resources/views/admin/profile/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @var \Arcanesoft\Auth\Models\User $user */ ?>
<?php /** @var Arcanesoft\Auth\Models\User $user */ ?>

@section('header')
<h1><i class="fa fa-fw fa-user"></i> Profile <small>{{ $user->full_name }}</small></h1>
Expand Down Expand Up @@ -49,31 +49,31 @@
</div>

{{-- EDIT PASSWORD --}}
{{ Form::open(['route' => ['admin::auth.profile.password.update', $user->hashed_id], 'method' => 'PUT', 'id' => 'updatePasswordForm', 'class' => 'form form-loading']) }}
{{ form()->open(['route' => ['admin::auth.profile.password.update', $user->hashed_id], 'method' => 'PUT', 'id' => 'updatePasswordForm', 'class' => 'form form-loading']) }}
<div class="box box-danger">
<div class="box-header with-border">
<h2 class="box-title">{{ trans('auth::profile.titles.password') }}</h2>
</div>
<div class="box-body">
<div class="form-group {{ $errors->first('old_password', 'has-error') }}">
{{ Form::label('old_password', trans('auth::profile.attributes.old-password').' :', ['class' => 'control-label']) }}
{{ Form::password('old_password', ['class' => 'form-control']) }}
{{ form()->label('old_password', trans('auth::profile.attributes.old-password').' :', ['class' => 'control-label']) }}
{{ form()->password('old_password', ['class' => 'form-control']) }}
@if ($errors->has('old_password'))
<span class="text-red">{!! $errors->first('old_password') !!}</span>
@endif
</div>

<div class="form-group {{ $errors->first('password', 'has-error') }}">
{{ Form::label('password', trans('auth::profile.attributes.new-password').' :', ['class' => 'control-label']) }}
{{ Form::password('password', ['class' => 'form-control']) }}
{{ form()->label('password', trans('auth::profile.attributes.new-password').' :', ['class' => 'control-label']) }}
{{ form()->password('password', ['class' => 'form-control']) }}
@if ($errors->has('password'))
<span class="text-red">{!! $errors->first('password') !!}</span>
@endif
</div>

<div class="form-group {{ $errors->first('password_confirmation', 'has-error') }}">
{{ Form::label('password_confirmation', trans('auth::users.attributes.password_confirmation'), ['class' => 'control-label']) }}
{{ Form::password('password_confirmation', ['class' => 'form-control']) }}
{{ form()->label('password_confirmation', trans('auth::users.attributes.password_confirmation'), ['class' => 'control-label']) }}
{{ form()->password('password_confirmation', ['class' => 'form-control']) }}
@if ($errors->has('password_confirmation'))
<span class="text-red">{!! $errors->first('password_confirmation') !!}</span>
@endif
Expand All @@ -83,7 +83,7 @@
{{ ui_button('update', 'submit')->withLoadingText() }}
</div>
</div>
{{ Form::close() }}
{{ form()->close() }}
</div>
<div class="col-md-8">
<div class="nav-tabs-custom">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php /** @var \Illuminate\Database\Eloquent\Collection $permissions */ ?>
<?php
/**
* @var Illuminate\Database\Eloquent\Collection $permissions
* @var Illuminate\Support\ViewErrorBag $errors
*/
?>

<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('auth::permissions.titles.permissions') }}</h3>
Expand All @@ -22,10 +28,10 @@
</thead>
<tbody>
@forelse ($permissions as $permission)
<?php /** @var \Arcanesoft\Auth\Models\Permission $permission */ ?>
<?php /** @var Arcanesoft\Auth\Models\Permission $permission */ ?>
<tr>
<td>
{{ Form::checkbox('permissions[]', $permission->id, $old->has($permission->id), ['data-permission-group' => $permission->group_id]) }}
{{ form()->checkbox('permissions[]', $permission->id, $old->has($permission->id), ['data-permission-group' => $permission->group_id]) }}
</td>
<td>
@if ($permission->hasGroup())
Expand Down
18 changes: 10 additions & 8 deletions resources/views/admin/roles/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php /** @var Illuminate\Support\ViewErrorBag $errors */ ?>

@section('header')
<h1><i class="fa fa-fw fa-lock"></i> {{ trans('auth::roles.titles.roles') }} <small>{{ trans('auth::roles.titles.create-role') }}</small></h1>
@endsection

@section('content')
{{ Form::open(['route' => 'admin::auth.roles.store', 'method' => 'POST', 'id' => 'createRoleForm', 'class' => 'form form-loading']) }}
{{ form()->open(['route' => 'admin::auth.roles.store', 'method' => 'POST', 'id' => 'createRoleForm', 'class' => 'form form-loading']) }}
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('auth::roles.titles.new-role') }}</h3>
Expand All @@ -12,26 +14,26 @@
<div class="row">
<div class="col-md-4">
<div class="form-group {{ $errors->first('name', 'has-error') }}">
{{ Form::label('name', trans('auth::roles.attributes.name'), ['class' => 'control-label']) }}
{{ Form::text('name', old('name'), ['class' => 'form-control']) }}
{{ form()->label('name', trans('auth::roles.attributes.name'), ['class' => 'control-label']) }}
{{ form()->text('name', old('name'), ['class' => 'form-control']) }}
@if ($errors->has('name'))
<span class="text-red">{!! $errors->first('name') !!}</span>
@endif
</div>
</div>
<div class="col-md-4">
<div class="form-group {{ $errors->first('slug', 'has-error') }}">
{{ Form::label('slug', trans('auth::roles.attributes.slug'), ['class' => 'control-label']) }}
{{ Form::text('slug', old('slug'), ['class' => 'form-control']) }}
{{ form()->label('slug', trans('auth::roles.attributes.slug'), ['class' => 'control-label']) }}
{{ form()->text('slug', old('slug'), ['class' => 'form-control']) }}
@if ($errors->has('slug'))
<span class="text-red">{!! $errors->first('slug') !!}</span>
@endif
</div>
</div>
<div class="col-md-4">
<div class="form-group {{ $errors->first('description', 'has-error') }}">
{{ Form::label('description', trans('auth::roles.attributes.description'), ['class' => 'control-label']) }}
{{ Form::text('description', old('description'), ['class' => 'form-control']) }}
{{ form()->label('description', trans('auth::roles.attributes.description'), ['class' => 'control-label']) }}
{{ form()->text('description', old('description'), ['class' => 'form-control']) }}
@if ($errors->has('description'))
<span class="text-red">{!! $errors->first('description') !!}</span>
@endif
Expand All @@ -46,5 +48,5 @@
</div>

@include('auth::admin.roles._partials.permissions-checkbox', ['old' => old('permissions', collect())])
{{ Form::close() }}
{{ form()->close() }}
@endsection
Loading

0 comments on commit b1305d9

Please sign in to comment.