Skip to content

Commit 8955b42

Browse files
committed
Merge branch 'laravel-5.1' into 1.3
2 parents f299ba8 + 1af4ed6 commit 8955b42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1878
-10
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22

33
php:
4-
- 5.4
54
- 5.5
65
- 5.6
76

app/Authentication/AuthenticationServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public function boot()
7171
require __DIR__ . "/validators.php";
7272
// package routes
7373
require __DIR__ . '/../Http/routes.php';
74+
// other bootstrap commands
75+
require __DIR__ . '/bootstrap.php';
7476

7577
$this->registerCommands();
7678

app/Authentication/Controllers/UserController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function editProfile()
183183
{
184184
$user_profile = new UserProfile(["user_id" => $user_id]);
185185
}
186-
$custom_profile_repo = App::make('custom_profile_repository', $user_profile->id);
186+
$custom_profile_repo = App::make('custom_profile_repository', [$user_profile->id]);
187187

188188
return View::make('laravel-authentication-acl::admin.user.profile')->with([
189189
'user_profile' => $user_profile,
@@ -215,7 +215,7 @@ public function editOwnProfile()
215215
{
216216
$logged_user = $this->auth->getLoggedUser();
217217

218-
$custom_profile_repo = App::make('custom_profile_repository', $logged_user->user_profile()->first()->id);
218+
$custom_profile_repo = App::make('custom_profile_repository', [$logged_user->user_profile()->first()->id]);
219219

220220
return View::make('laravel-authentication-acl::admin.user.self-profile')
221221
->with([

app/Authentication/Services/UserProfileService.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* @author jacopo beschi jacopo@jacopobeschi.com
77
*/
88
use App;
9-
use Illuminate\Database\Eloquent\ModelNotFoundException;
109
use Illuminate\Support\MessageBag;
1110
use LaravelAcl\Authentication\Exceptions\PermissionException;
1211
use LaravelAcl\Authentication\Validators\UserProfileUserValidator;
@@ -123,7 +122,7 @@ public function getErrors()
123122
*/
124123
protected function saveCustomProfileFields($input, $user_profile)
125124
{
126-
$custom_profile_repository = App::make('custom_profile_repository', $user_profile->id);
125+
$custom_profile_repository = App::make('custom_profile_repository', [$user_profile->id]);
127126
foreach($input as $input_key => $value)
128127
{
129128
if(($profile_field_type_id_position = $this->isCustomFieldKey($input_key)) !== false)

app/Authentication/bootstrap.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
// increase max nesting level
3+
ini_set('xdebug.max_nesting_level', 250);

bootstrap/autoload.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
|
2828
*/
2929

30-
$compiledPath = __DIR__.'/../storage/framework/compiled.php';
30+
//$compiledPath = __DIR__.'/../storage/framework/compiled.php';
31+
// Laravel 5.1 upgrade
32+
$compiledPath = __DIR__.'/cache/compiled.php';
3133

3234
if (file_exists($compiledPath))
3335
{

bootstrap/cache/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

config/app.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@
136136
'Illuminate\Validation\ValidationServiceProvider',
137137
'Illuminate\View\ViewServiceProvider',
138138

139+
// Laravel 5.1 upgrade
140+
//'Illuminate\Broadcasting\BroadcastServiceProvider',
141+
139142
/*
140143
* Application Service Providers...
141144
*/

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ a simple admin panel with an ACL using Laravel framework.
1818
To install this software you need:
1919

2020
* Laravel framework 5.*
21-
* Php 5.4+
21+
* Php 5.5+
2222
* GD Library or Imagick
2323
* Enable Fileinfo extension(may be needed for windows users) <a href="http://php.net/manual/en/fileinfo.installation.php">how to enable it</a>
2424

@@ -48,7 +48,7 @@ To install authentication follow this steps:
4848
4949
6. Now you need to install the application, to do that run the command: `php artisan authentication:install`.
5050
51-
Congratulations! You have succesfully installed Laravel Authentication ACL package!
51+
Congratulations! You have successfully installed Laravel Authentication ACL package!
5252
5353
Here is the main application links:
5454
@@ -59,7 +59,7 @@ To install authentication follow this steps:
5959
* http://url_of_your_application/user/logout the logout page
6060
6161
### Note on sending emails ###
62-
Keep in mind this software will send various notification emails, dont't forget to edit your _laravel config/mail.php_ file aswell.
62+
Keep in mind this software will send various notification emails, don't forget to edit your _laravel config/mail.php_ file aswell.
6363
6464
## <a name="configuration">Configuration</a> ##
6565
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@extends('laravel-authentication-acl::admin.layouts.baseauth')
2+
@section('title')
3+
Admin login
4+
@stop
5+
@section('container')
6+
<div class="row centered-form">
7+
<div class="col-xs-12 col-sm-8 col-md-4 col-sm-offset-2 col-md-offset-4">
8+
<div class="panel panel-info">
9+
<div class="panel-heading">
10+
<h3 class="panel-title bariol-thin">Login to {!!Config::get('acl_base.app_name')!!}</h3>
11+
</div>
12+
<?php $message = Session::get('message'); ?>
13+
@if( isset($message) )
14+
<div class="alert alert-success">{{$message}}</div>
15+
@endif
16+
@if($errors && ! $errors->isEmpty() )
17+
@foreach($errors->all() as $error)
18+
<div class="alert alert-danger">{{$error}}</div>
19+
@endforeach
20+
@endif
21+
<div class="panel-body">
22+
{!! Form::open(array('url' => URL::route("user.login.process"), 'method' => 'post') ) !!}
23+
<div class="row">
24+
<div class="col-xs-12 col-sm-12 col-md-12">
25+
<div class="form-group">
26+
<div class="input-group">
27+
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
28+
{!! Form::email('email', '', ['id' => 'email', 'class' => 'form-control', 'placeholder' => 'Email address', 'required', 'autocomplete' => 'off']) !!}
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
<div class="row">
34+
<div class="col-xs-12 col-sm-12 col-md-12">
35+
<div class="form-group">
36+
<div class="input-group">
37+
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
38+
{!! Form::password('password', ['id' => 'password', 'class' => 'form-control', 'placeholder' => 'Password', 'required', 'autocomplete' => 'off']) !!}
39+
</div>
40+
</div>
41+
</div>
42+
</div>
43+
{!! Form::label('remember','Remember me') !!}
44+
{!! Form::checkbox('remember') !!}
45+
<input type="submit" value="Login" class="btn btn-info btn-block">
46+
{!! Form::close() !!}
47+
<div class="row">
48+
<div class="col-xs-12 col-sm-12 col-md-12 margin-top-10">
49+
{!! link_to_route('user.reminder.process','Forgot password?') !!}
50+
</div>
51+
</div>
52+
</div>
53+
</div>
54+
</div>
55+
</div>
56+
@stop
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@extends('laravel-authentication-acl::admin.layouts.base-2cols')
2+
3+
@section('title')
4+
Admin area: dashboard
5+
@stop
6+
7+
@section('content')
8+
<div class="row">
9+
<div class="col-md-12 col-sm-12 col-xs-12">
10+
<h3><i class="fa fa-dashboard"></i> Dashboard</h3>
11+
<hr/>
12+
</div>
13+
<div class="col-md-12 col-sm-12 col-xs-12">
14+
<div class="stats-item margin-left-5 margin-bottom-12"><i class="fa fa-user icon-large"></i> <span class="text-large margin-left-15">{!! $registered !!}</span>
15+
<br/>Total users</div>
16+
<div class="stats-item margin-left-5 margin-bottom-12"><i class="fa fa-unlock-alt icon-large"></i> <span class="text-large margin-left-15">{!! $active !!}</span>
17+
<br/>Active users</div>
18+
<div class="stats-item margin-left-5 margin-bottom-12"><i class="fa fa-lock icon-large"></i> <span class="text-large margin-left-15">{!! $pending !!}</span>
19+
<br/>Pending users</div>
20+
<div class="stats-item margin-left-5 margin-bottom-12"><i class="fa fa-ban icon-large"></i> <span class="text-large margin-left-15">{!! $banned !!}</span>
21+
<br/>Banned users</div>
22+
</div>
23+
</div>
24+
@stop
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
@extends('laravel-authentication-acl::admin.layouts.base-2cols')
2+
3+
@section('title')
4+
Admin area: edit group
5+
@stop
6+
7+
@section('content')
8+
<div class="row">
9+
<div class="col-md-12">
10+
{{-- model general errors from the form --}}
11+
@if($errors->has('model') )
12+
<div class="alert alert-danger">{!! $errors->first('model') !!}</div>
13+
@endif
14+
15+
{{-- successful message --}}
16+
<?php $message = Session::get('message'); ?>
17+
@if( isset($message) )
18+
<div class="alert alert-success">{{$message}}</div>
19+
@endif
20+
<div class="panel panel-info">
21+
<div class="panel-heading">
22+
<h3 class="panel-title bariol-thin">{!! isset($group->id) ? '<i class="fa fa-pencil"></i> Edit' : '<i class="fa fa-users"></i> Create' !!} group</h3>
23+
</div>
24+
<div class="panel-body">
25+
<div class="row">
26+
<div class="col-md-6 col-xs-12">
27+
{{-- group base form --}}
28+
<h4>General data</h4>
29+
{!! Form::model($group, [ 'url' => [URL::route('groups.edit'), $group->id], 'method' => 'post'] ) !!}
30+
<!-- name text field -->
31+
<div class="form-group">
32+
{!! Form::label('name','Name: *') !!}
33+
{!! Form::text('name', null, ['class' => 'form-control', 'placeholder' => 'group name']) !!}
34+
</div>
35+
<span class="text-danger">{!! $errors->first('name') !!}</span>
36+
{!! Form::hidden('id') !!}
37+
<a href="{!! URL::route('groups.delete',['id' => $group->id, '_token' => csrf_token()]) !!}" class="btn btn-danger pull-right margin-left-5 delete">Delete</a>
38+
{!! Form::submit('Save', array("class"=>"btn btn-info pull-right ")) !!}
39+
{!! Form::close() !!}
40+
</div>
41+
<div class="col-md-6 col-xs-12">
42+
{{-- group permission form --}}
43+
<h4><i class="fa fa-lock"></i> Permissions</h4>
44+
{{-- permissions --}}
45+
@include('laravel-authentication-acl::admin.group.perm')
46+
</div>
47+
</div>
48+
</div>
49+
</div>
50+
</div>
51+
</div>
52+
@stop
53+
54+
@section('footer_scripts')
55+
<script>
56+
$(".delete").click(function(){
57+
return confirm("Are you sure to delete this item?");
58+
});
59+
</script>
60+
@stop
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<div class="row margin-bottom-12">
2+
<div class="col-md-12">
3+
<a href="{!! URL::route('groups.edit') !!}" class="btn btn-info pull-right"><i class="fa fa-plus"></i> Add New</a>
4+
</div>
5+
</div>
6+
@if( ! $groups->isEmpty() )
7+
<table class="table table-hover">
8+
<thead>
9+
<tr>
10+
<th>Group name</th>
11+
<th>Operations</th>
12+
</tr>
13+
</thead>
14+
<tbody>
15+
@foreach($groups as $group)
16+
<tr>
17+
<td style="width:90%">{!! $group->name !!}</td>
18+
<td style="width:10%">
19+
@if(! $group->protected)
20+
<a href="{!! URL::route('groups.edit', ['id' => $group->id]) !!}"><i class="fa fa-edit fa-2x"></i></a>
21+
<a href="{!! URL::route('groups.delete',['id' => $group->id, '_token' => csrf_token()]) !!}" class="margin-left-5 delete"><i class="fa fa-trash-o fa-2x"></i></a>
22+
<span class="clearfix"></span>
23+
@else
24+
<i class="fa fa-times fa-2x light-blue"></i>
25+
<i class="fa fa-times fa-2x margin-left-12 light-blue"></i>
26+
@endif
27+
</td>
28+
</tr>
29+
@endforeach
30+
</tbody>
31+
</table>
32+
@else
33+
<span class="text-warning"><h5>No results found.</h5></span>
34+
@endif
35+
<div class="paginator">
36+
{!! $groups->appends(Input::except(['page']) )->render() !!}
37+
</div>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@extends('laravel-authentication-acl::admin.layouts.base-2cols')
2+
3+
@section('title')
4+
Admin area: Groups list
5+
@stop
6+
7+
@section('content')
8+
9+
<div class="row">
10+
<div class="col-md-12">
11+
<div class="col-md-8">
12+
{{-- print messages --}}
13+
<?php $message = Session::get('message'); ?>
14+
@if( isset($message) )
15+
<div class="alert alert-success">{!! $message !!}</div>
16+
@endif
17+
{{-- print errors --}}
18+
@if($errors && ! $errors->isEmpty() )
19+
@foreach($errors->all() as $error)
20+
<div class="alert alert-danger">{!! $error !!}</div>
21+
@endforeach
22+
@endif
23+
<div class="panel panel-info">
24+
<div class="panel-heading">
25+
<h3 class="panel-title bariol-thin"><i class="fa fa-group"></i> {!! Input::all() ? 'Search results:' : 'Groups' !!}</h3>
26+
</div>
27+
<div class="panel-body">
28+
@include('laravel-authentication-acl::admin.group.groups-table')
29+
</div>
30+
</div>
31+
</div>
32+
<div class="col-md-4">
33+
@include('laravel-authentication-acl::admin.group.search')
34+
</div>
35+
</div>
36+
</div>
37+
@stop
38+
39+
@section('footer_scripts')
40+
<script>
41+
$(".delete").click(function(){
42+
return confirm("Are you sure to delete this item?");
43+
});
44+
</script>
45+
@stop
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{!! Form::open(["route" => "groups.edit.permission","role"=>"form", 'class' => 'form-add-perm']) !!}
2+
<div class="form-group">
3+
<div class="input-group">
4+
<span class="input-group-addon form-button button-add-perm"><span class="glyphicon glyphicon-plus-sign add-input"></span></span>
5+
{!! Form::select('permissions', $permission_values, '', ["class"=>"form-control permission-select"]) !!}
6+
</div>
7+
<span class="text-danger">{!! $errors->first('permissions') !!}</span>
8+
{!! Form::hidden('id', $group->id) !!}
9+
{{-- add permission operation --}}
10+
{!! Form::hidden('operation', 1) !!}
11+
</div>
12+
<div class="form-group">
13+
@if(! $group->exists)
14+
<span class="text-danger"><h5>You need to create a group first.</h5></span>
15+
@endif
16+
</div>
17+
{!! Form::close() !!}
18+
19+
@if( $presenter->permissions )
20+
@foreach($presenter->permissions_obj as $permission)
21+
{!! Form::open(["route" => "groups.edit.permission", "role"=>"form", 'name' => $permission->permission]) !!}
22+
<div class="form-group">
23+
<div class="input-group">
24+
<span class="input-group-addon form-button button-del-perm" name="{!! $permission->permission !!}"><span class="glyphicon glyphicon-minus-sign add-input"></span></span>
25+
{!! Form::text('permission_desc', $permission->description, ['class' => 'form-control', 'readonly' => 'readonly']) !!}
26+
{!! Form::hidden('permissions', $permission->permission) !!}
27+
{!! Form::hidden('id', $group->id) !!}
28+
{{-- add permission operation --}}
29+
{!! Form::hidden('operation', 0) !!}
30+
</div>
31+
</div>
32+
{!! Form::close() !!}
33+
@endforeach
34+
@elseif($group->exists)
35+
<span class="text-warning"><h5>There is no permission associated to the group.</h5></span>
36+
@endif
37+
38+
@section('footer_scripts')
39+
@parent
40+
<script>
41+
$(".button-add-perm").click( function(){
42+
<?php if($group->exists): ?>
43+
$('.form-add-perm').submit();
44+
<?php endif; ?>
45+
});
46+
$(".button-del-perm").click( function(){
47+
name = $(this).attr('name');
48+
$('form[name='+name+']').submit();
49+
});
50+
</script>
51+
@stop

0 commit comments

Comments
 (0)