Commit 4273e495 authored by Nicolas Widart's avatar Nicolas Widart

Squashed 'Modules/User/' changes from c5fd9da..4cfd87c

4cfd87c Update to conform to the new pingpong/Modules package
c0fb3ed Remove Sentinel hard dependency in view

git-subtree-dir: Modules/User
git-subtree-split: 4cfd87c2e137382e759739ffaada5062ed4cf945
parent 24d99222
......@@ -3,6 +3,7 @@
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
use Laracasts\Flash\Flash;
use Modules\Core\Contracts\Authentication;
use Modules\Core\Permissions\PermissionManager;
use Modules\User\Http\Requests\CreateUserRequest;
use Modules\User\Http\Requests\UpdateUserRequest;
......@@ -19,14 +20,23 @@ class UserController extends BaseUserModuleController
* @var RoleRepository
*/
private $role;
public function __construct(PermissionManager $permissions, UserRepository $user, RoleRepository $role)
{
/**
* @var Authentication
*/
private $auth;
public function __construct(
PermissionManager $permissions,
UserRepository $user,
RoleRepository $role,
Authentication $auth
) {
parent::__construct();
$this->permissions = $permissions;
$this->user = $user;
$this->role = $role;
$this->auth = $auth;
}
/**
......@@ -38,7 +48,9 @@ class UserController extends BaseUserModuleController
{
$users = $this->user->all();
return View::make('user::admin.users.index', compact('users'));
$currentUser = $this->auth->check();
return View::make('user::admin.users.index', compact('users', 'currentUser'));
}
/**
......
......@@ -10,7 +10,7 @@
@stop
@section('styles')
<link href="{{{ Module::asset('core', 'css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
......
......@@ -12,7 +12,7 @@
@stop
@section('styles')
<link href="{{{ Module::asset('core', 'css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
......
......@@ -12,7 +12,7 @@
@stop
@section('styles')
<link href="{{{ Module::asset('core', 'css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
......
......@@ -12,7 +12,7 @@
@stop
@section('styles')
<link href="{{{ Module::asset('core', 'css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
......
......@@ -62,7 +62,7 @@
<td>
<div class="btn-group">
<a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}" class="btn btn-default btn-flat"><i class="glyphicon glyphicon-pencil"></i></a>
<?php if ($user->id != \Cartalyst\Sentinel\Laravel\Facades\Sentinel::check()->id): ?>
<?php if ($user->id != $currentUser->id): ?>
<button class="btn btn-danger btn-flat" data-toggle="modal" data-target="#confirmation-{{ $user->id }}"><i class="glyphicon glyphicon-trash"></i></button>
<?php endif; ?>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment