Commit 200db025 authored by Nicolas Widart's avatar Nicolas Widart

Removing user module

parent 39561d3c
rules:
php.interface_has_no_interface_suffix:
enabled: false
language: php
php:
- 5.6
- 5.5
- 5.4
- hhvm
<?php namespace Modules\User\Commands;
class BeginResetProcessCommand
{
public $email;
public function __construct($email)
{
$this->email = $email;
}
}
<?php namespace Modules\User\Commands;
use Illuminate\Support\Facades\Event;
use Laracasts\Commander\CommandHandler;
use Modules\User\Events\UserHasBegunResetProcess;
use Modules\User\Exceptions\UserNotFoundException;
use Modules\User\Repositories\AuthenticationRepository;
use Modules\User\Repositories\UserRepository;
class BeginResetProcessCommandHandler implements CommandHandler
{
/**
* @var UserRepository
*/
private $user;
/**
* @var AuthenticationRepository
*/
private $auth;
public function __construct(UserRepository $user, AuthenticationRepository $auth)
{
$this->user = $user;
$this->auth = $auth;
}
/**
* Handle the command
*
* @param $command
* @throws UserNotFoundException
* @return mixed
*/
public function handle($command)
{
$user = $this->findUser((array) $command);
$code = $this->auth->createReminderCode($user);
Event::fire('Modules.User.Events.UserHasBegunResetProcess', new UserHasBegunResetProcess($user, $code));
}
private function findUser($credentials)
{
$user = $this->user->findByCredentials((array) $credentials);
if ($user) {
return $user;
}
throw new UserNotFoundException();
}
}
<?php namespace Modules\User\Commands;
class CompleteResetProcessCommand
{
public $password_confirmation;
public $password;
public $userId;
public $code;
public function __construct($password, $password_confirmation, $userId, $code)
{
$this->password_confirmation = $password_confirmation;
$this->password = $password;
$this->userId = $userId;
$this->code = $code;
}
}
<?php namespace Modules\User\Commands;
use Laracasts\Commander\CommandHandler;
use Modules\User\Exceptions\InvalidOrExpiredResetCode;
use Modules\User\Exceptions\UserNotFoundException;
use Modules\User\Repositories\AuthenticationRepository;
use Modules\User\Repositories\UserRepository;
class CompleteResetProcessCommandHandler implements CommandHandler
{
protected $input;
/**
* @var UserRepository
*/
private $user;
/**
* @var AuthenticationRepository
*/
private $auth;
public function __construct(UserRepository $user, AuthenticationRepository $auth)
{
$this->user = $user;
$this->auth = $auth;
}
/**
* Handle the command
*
* @param $command
* @throws InvalidOrExpiredResetCode
* @throws UserNotFoundException
* @return mixed
*/
public function handle($command)
{
$this->input = $command;
$user = $this->findUser();
if (!$this->auth->completeResetPassword($user, $this->input->code, $this->input->password)) {
throw new InvalidOrExpiredResetCode;
}
return $user;
}
public function findUser()
{
$user = $this->user->find($this->input->userId);
if ($user) {
return $user;
}
throw new UserNotFoundException;
}
}
<?php namespace Modules\User\Commands;
class RegisterNewUserCommand
{
public $email;
public $password;
public $password_confirmation;
public function __construct($email, $password, $password_confirmation)
{
$this->email = $email;
$this->password = $password;
$this->password_confirmation = $password_confirmation;
}
}
<?php namespace Modules\User\Commands;
use Illuminate\Support\Facades\Event;
use Laracasts\Commander\CommandHandler;
use Modules\User\Events\UserHasRegistered;
use Modules\User\Repositories\AuthenticationRepository;
use Modules\User\Repositories\RoleRepository;
class RegisterNewUserCommandHandler implements CommandHandler
{
protected $input;
/**
* @var AuthenticationRepository
*/
private $auth;
/**
* @var RoleRepository
*/
private $role;
public function __construct(AuthenticationRepository $auth, RoleRepository $role)
{
$this->auth = $auth;
$this->role = $role;
}
/**
* Handle the command
*
* @param $input
* @return mixed
*/
public function handle($input)
{
$this->input = $input;
$user = $this->createUser();
$this->assignUserToUsersGroup($user);
Event::fire('Modules.User.Events.UserHasRegistered', new UserHasRegistered($user));
return $user;
}
private function createUser()
{
return $this->auth->register((array) $this->input);
}
private function assignUserToUsersGroup($user)
{
$role = $this->role->findByName('User');
$this->auth->assignRole($user, $role);
}
}
<?php namespace Modules\User\Composers;
use Modules\Core\Permissions\PermissionManager;
class PermissionsViewComposer
{
/**
* @var PermissionManager
*/
private $permissions;
public function __construct(PermissionManager $permissions)
{
$this->permissions = $permissions;
}
public function compose($view)
{
// Get all permissions
$view->permissions = $this->permissions->all();
}
}
<?php namespace Modules\User\Composers;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Request;
use Modules\Core\Composers\BaseSidebarViewComposer;
class SidebarViewComposer extends BaseSidebarViewComposer
{
public function compose(View $view)
{
$view->items->put('user', Collection::make([
[
'weight' => '1',
'request' => Request::is("*/{$view->prefix}/users*") or Request::is("*/{$view->prefix}/roles*"),
'route' => '#',
'icon-class' => 'fa fa-user',
'title' => 'Users & Roles',
'permission' => $this->auth->hasAccess('users.index') or $this->auth->hasAccess('roles.index')
],
[
'request' => "*/{$view->prefix}/users*",
'route' => 'dashboard.user.index',
'icon-class' => 'fa fa-user',
'title' => 'Users',
'permission' => $this->auth->hasAccess('users.index')
],
[
'request' => "*/{$view->prefix}/roles*",
'route' => 'dashboard.role.index',
'icon-class' => 'fa fa-flag-o',
'title' => 'Roles',
'permission' => $this->auth->hasAccess('roles.index')
]
]));
}
}
<?php namespace Modules\User\Composers;
use Illuminate\Contracts\View\View;
use Modules\Core\Composers\BaseSidebarViewComposer;
class UsernameViewComposer extends BaseSidebarViewComposer
{
public function compose(View $view)
{
$view->with('user', $this->auth->check());
}
}
<?php
return [
'users' => [
'index',
'create',
'store',
'edit',
'update',
'destroy'
],
'roles' => [
'index',
'create',
'store',
'edit',
'update',
'destroy'
],
];
<?php namespace Modules\User\Database\Seeders;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class SentinelGroupSeedTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$groups = Sentinel::getRoleRepository();
// Create an Admin group
$groups->createModel()->create(
[
'name' => 'Admin',
'slug' => 'admin',
]
);
// Create an Users group
$groups->createModel()->create(
[
'name' => 'User',
'slug' => 'user',
]
);
// Save the permissions
$group = Sentinel::findRoleBySlug('admin');
$group->permissions = [
'dashboard.index' => true,
/* Workbench */
'workbench.index' => true,
'workbench.generate' => true,
'workbench.migrate' => true,
'workbench.install' => true,
'workbench.seed' => true,
'modules.index' => true,
'modules.store' => true,
'generate.generate' => true,
'install.install' => true,
'migrate.migrate' => true,
'seed.seed' => true,
/* Roles */
'roles.index' => true,
'roles.create' => true,
'roles.store' => true,
'roles.edit' => true,
'roles.update' => true,
'roles.destroy' => true,
/* Users */
'users.index' => true,
'users.create' => true,
'users.store' => true,
'users.edit' => true,
'users.update' => true,
'users.destroy' => true,
/* Menu */
'menus.index' => true,
'menus.create' => true,
'menus.store' => true,
'menus.edit' => true,
'menus.update' => true,
'menus.destroy' => true,
'menuitem.index' => true,
'menuitem.create' => true,
'menuitem.store' => true,
'menuitem.edit' => true,
'menuitem.update' => true,
'menuitem.destroy' => true,
/* Media */
'media.index' => true,
'media.create' => true,
'media.store' => true,
'media.edit' => true,
'media.update' => true,
'media.destroy' => true,
/* Settings */
'settings.index' => true,
];
$group->save();
$group = Sentinel::findRoleBySlug('user');
$group->permissions = [
'dashboard.index' => true
];
$group->save();
}
}
<?php namespace Modules\User\Database\Seeders;
use Cartalyst\Sentinel\Laravel\Facades\Activation;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class SentinelUserSeedTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// Create an admin user
$user = Sentinel::create(
[
'email' => 'n.widart@gmail.com',
'password' => 'test',
'first_name' => 'Nicolas',
'last_name' => 'Widart'
]
);
// Activate the admin directly
$activation = Activation::create($user);
Activation::complete($user, $activation->code);
// Find the group using the group id
$adminGroup = Sentinel::findRoleBySlug('admin');
// Assign the group to the user
$adminGroup->users()->attach($user);
}
}
<?php namespace Modules\User\Database\Seeders;
use Cartalyst\Sentry\Facades\Laravel\Sentry;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class SentryGroupSeedTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// Create an Admin group
Sentry::createGroup(array(
'name' => 'Admin',
'permissions' => [
'dashboard.index' => 1,
/* Workbench */
'workbench.index' => 1,
'workbench.generate' => 1,
'workbench.migrate' => 1,
'workbench.install' => 1,
'workbench.seed' => 1,
'modules.index' => 1,
'modules.store' => 1,
'generate.generate' => 1,
'install.install' => 1,
'migrate.migrate' => 1,
'seed.seed' => 1,
/* Roles */
'roles.index' => 1,
'roles.create' => 1,
'roles.store' => 1,
'roles.edit' => 1,
'roles.update' => 1,
'roles.destroy' => 1,
/* Users */
'users.index' => 1,
'users.create' => 1,
'users.store' => 1,
'users.edit' => 1,
'users.update' => 1,
'users.destroy' => 1,
/* Menu */
'menus.index' => 1,
'menus.create' => 1,
'menus.store' => 1,
'menus.edit' => 1,
'menus.update' => 1,
'menus.destroy' => 1,
'menuitem.index' => 1,
'menuitem.create' => 1,
'menuitem.store' => 1,
'menuitem.edit' => 1,
'menuitem.update' => 1,
'menuitem.destroy' => 1,
/* Media */
'media.index' => 1,
'media.create' => 1,
'media.store' => 1,
'media.edit' => 1,
'media.update' => 1,
'media.destroy' => 1,
/* Settings */
'settings.index' => 1,
],
));
// Create an Users group
Sentry::createGroup(array(
'name' => 'User',
'permissions' => [
'dashboard.index' => 1,
],
));
}
}
<?php namespace Modules\User\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class UserDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call("Modules\\User\\Database\\Seeders\\SentinelGroupSeedTableSeeder");
}
}
<?php namespace Modules\User\Entities\Sentinel;
use Cartalyst\Sentinel\Users\EloquentUser;
use Laracasts\Presenter\PresentableTrait;
use Modules\User\Entities\UserInterface;
class User extends EloquentUser implements UserInterface
{
use PresentableTrait;
protected $fillable = [
'email',
'password',
'permissions',
'first_name',
'last_name'
];
protected $presenter = 'Modules\User\Presenters\UserPresenter';
public function hasRole($roleId)
{
return $this->roles()->whereId($roleId)->count() >= 1;
}
}
<?php namespace Modules\User\Entities\Sentry;
use Cartalyst\Sentry\Facades\Laravel\Sentry;
use Cartalyst\Sentry\Users\Eloquent\User as SentryModel;
use Laracasts\Presenter\PresentableTrait;
use Modules\User\Entities\UserInterface;
class User extends SentryModel implements UserInterface
{
use PresentableTrait;
protected $fillable = [
'email',
'password',
'permissions',
'first_name',
'last_name'
];
protected $presenter = 'Modules\User\Presenters\UserPresenter';
public function groups()
{
return $this->belongsToMany(static::$groupModel, static::$userGroupsPivot, 'user_id');
}
/**
* Checks if a user belongs to the given Role ID
* @param int $roleId
* @return bool
*/
public function hasRole($roleId)
{
$role = Sentry::findGroupById($roleId);
return $this->inGroup($role);
}
}
<?php namespace Modules\User\Entities;
interface UserInterface
{
/**
* Checks if a user belongs to the given Role ID
* @param int $roleId
* @return bool
*/
public function hasRole($roleId);
}
<?php namespace Modules\User\Events;
class UserHasBegunResetProcess
{
public $user;
public $code;
public function __construct($user, $code)
{
$this->user = $user;
$this->code = $code;
}
}
<?php namespace Modules\User\Events;
class UserHasRegistered
{
public $user;
public function __construct($user)
{
$this->user = $user;
}
}
<?php namespace Modules\User\Exceptions;
use Exception;
class InvalidOrExpiredResetCode extends Exception
{
}
<?php namespace Modules\User\Exceptions;
use Exception;
class UserNotFoundException extends Exception
{
}
<?php namespace Modules\User\Http\Controllers\Admin;
use Modules\Core\Http\Controllers\Admin\AdminBaseController;
abstract class BaseUserModuleController extends AdminBaseController
{
/**
* @var PermissionManager
*/
protected $permissions;
/**
* @param $request
* @return array
*/
protected function mergeRequestWithPermissions($request)
{
return array_merge($request->all(), ['permissions' => $this->permissions->clean($request->permissions)]);
}
}
<?php namespace Modules\User\Http\Controllers\Admin;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
use Laracasts\Flash\Flash;
use Modules\Core\Permissions\PermissionManager;
use Modules\User\Http\Requests\RolesRequest;
use Modules\User\Repositories\RoleRepository;
class RolesController extends BaseUserModuleController
{
/**
* @var RoleRepository
*/
private $role;
public function __construct(PermissionManager $permissions, RoleRepository $role)
{
parent::__construct();
$this->permissions = $permissions;
$this->role = $role;
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$roles = $this->role->all();
return View::make('user::admin.roles.index', compact('roles'));
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return View::make('user::admin.roles.create');
}
/**
* Store a newly created resource in storage.
*
* @param RolesRequest $request
* @return Response
*/
public function store(RolesRequest $request)
{
$data = $this->mergeRequestWithPermissions($request);
$this->role->create($data);
Flash::success(trans('user::messages.role created'));
return Redirect::route('dashboard.role.index');
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
if (!$role = $this->role->find($id)) {
Flash::error(trans('user::messages.role not found'));
return Redirect::to('user::admin.roles.index');
}
return View::make('user::admin.roles.edit', compact('role'));
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @param RolesRequest $request
* @return Response
*/
public function update($id, RolesRequest $request)
{
$data = $this->mergeRequestWithPermissions($request);
$this->role->update($id, $data);
Flash::success(trans('user::messages.role updated'));
return Redirect::route('dashboard.role.index');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$this->role->delete($id);
Flash::success(trans('user::messages.role deleted'));
return Redirect::route('dashboard.role.index');
}
}
<?php namespace Modules\User\Http\Controllers\Admin;
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;
use Modules\User\Repositories\RoleRepository;
use Modules\User\Repositories\UserRepository;
class UserController extends BaseUserModuleController
{
/**
* @var UserRepository
*/
private $user;
/**
* @var RoleRepository
*/
private $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;
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$users = $this->user->all();
$currentUser = $this->auth->check();
return View::make('user::admin.users.index', compact('users', 'currentUser'));
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$roles = $this->role->all();
return View::make('user::admin.users.create', compact('roles'));
}
/**
* Store a newly created resource in storage.
*
* @param CreateUserRequest $request
* @return Response
*/
public function store(CreateUserRequest $request)
{
$data = $this->mergeRequestWithPermissions($request);
$this->user->createWithRoles($data, $request->roles, true);
Flash::success(trans('user::messages.user created'));
return Redirect::route('dashboard.user.index');
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
if (!$user = $this->user->find($id)) {
Flash::error(trans('user::messages.user not found'));
return Redirect::route('dashboard.user.index');
}
$roles = $this->role->all();
return View::make('user::admin.users.edit', compact('user', 'roles'));
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @param UpdateUserRequest $request
* @return Response
*/
public function update($id, UpdateUserRequest $request)
{
$data = $this->mergeRequestWithPermissions($request);
$this->user->updateAndSyncRoles($id, $data, $request->roles);
Flash::success(trans('user::messages.user updated'));
return Redirect::route('dashboard.user.index');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$this->user->delete($id);
Flash::success(trans('user::messages.user deleted'));
return Redirect::route('dashboard.user.index');
}
}
<?php namespace Modules\User\Http\Controllers;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
use Laracasts\Commander\CommanderTrait;
use Laracasts\Flash\Flash;
use Modules\Core\Contracts\Authentication;
use Modules\User\Exceptions\InvalidOrExpiredResetCode;
use Modules\User\Exceptions\UserNotFoundException;
use Modules\User\Http\Requests\LoginRequest;
use Modules\User\Http\Requests\RegisterRequest;
use Modules\User\Http\Requests\ResetCompleteRequest;
use Modules\User\Http\Requests\ResetRequest;
class AuthController
{
use CommanderTrait;
/**
* @var AuthenticationRepository
*/
private $auth;
public function __construct(Authentication $auth)
{
$this->auth = $auth;
}
public function getLogin()
{
return View::make('user::public.login');
}
public function postLogin(LoginRequest $request)
{
$credentials = [
'email' => $request->email,
'password' => $request->password
];
$remember = (bool)$request->get('remember_me', false);
$error = $this->auth->login($credentials, $remember);
if (!$error) {
Flash::success(trans('user::messages.successfully logged in'));
return Redirect::intended('/');
}
Flash::error($error);
return Redirect::back()->withInput();
}
public function getRegister()
{
return View::make('user::public.register');
}
public function postRegister(RegisterRequest $request)
{
$this->execute('Modules\User\Commands\RegisterNewUserCommand', $request->all());
Flash::success(trans('user::messages.account created check email for activation'));
return Redirect::route('register');
}
public function getLogout()
{
$this->auth->logout();
return Redirect::route('login');
}
public function getActivate($userId, $code)
{
if ($this->auth->activate($userId, $code)) {
Flash::success(trans('user::messages.account activated you can now login'));
return Redirect::route('login');
}
Flash::error(lang('user::messages.there was an error with the activation'));
return Redirect::route('register');
}
public function getReset()
{
return View::make('user::public.reset.begin');
}
public function postReset(ResetRequest $request)
{
try {
$this->execute('Modules\User\Commands\BeginResetProcessCommand', $request->all());
} catch (UserNotFoundException $e) {
Flash::error(trans('user::messages.no user found'));
return Redirect::back()->withInput();
}
Flash::success(trans('user::messages.check email to reset password'));
return Redirect::route('reset');
}
public function getResetComplete()
{
return View::make('user::public.reset.complete');
}
public function postResetComplete($userId, $code, ResetCompleteRequest $request)
{
try {
$this->execute(
'Modules\User\Commands\CompleteResetProcessCommand',
array_merge($request->all(), ['userId' => $userId, 'code' => $code])
);
} catch (UserNotFoundException $e) {
Flash::error(trans('user::messages.user no longer exists'));
return Redirect::back()->withInput();
} catch (InvalidOrExpiredResetCode $e) {
Flash::error(trans('user::messages.invalid reset code'));
return Redirect::back()->withInput();
}
Flash::success(trans('user::messages.password reset'));
return Redirect::route('login');
}
}
<?php namespace Modules\User\Http\Filters;
use Illuminate\Routing\Redirector;
use Modules\Core\Contracts\Authentication;
class GuestFilter
{
/**
* @var Authentication
*/
private $auth;
/**
* @var Redirector
*/
private $redirect;
public function __construct(Authentication $auth, Redirector $redirect)
{
$this->auth = $auth;
$this->redirect = $redirect;
}
public function filter()
{
if ($this->auth->check()) {
return $this->redirect->route('dashboard.index');
}
}
}
<?php namespace Modules\User\Http\Middleware;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Closure;
use Illuminate\Contracts\Routing\Middleware;
use Illuminate\Support\Facades\Redirect;
class GuestMiddleware implements Middleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
dd('ok?');
if (Sentinel::check()) {
return Redirect::route('dashboard.index');
}
}
}
<?php namespace Modules\User\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CreateUserRequest extends FormRequest
{
public function rules()
{
return [
'first_name' => 'required',
'last_name' => 'required',
'email' => 'required|unique:users|email',
'password' => 'required|min:3|confirmed',
];
}
public function authorize()
{
return true;
}
public function messages()
{
return [];
}
}
<?php namespace Modules\User\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class LoginRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'email' => 'required',
'password' => 'required',
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
public function messages()
{
return [];
}
}
<?php namespace Modules\User\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class RegisterRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'email' => 'required|email|unique:users',
'password' => 'required|confirmed|min:3',
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
public function messages()
{
return [];
}
}
<?php namespace Modules\User\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ResetCompleteRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'password' => 'required|min:3|confirmed',
'password_confirmation' => 'required'
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
public function messages()
{
return [];
}
}
<?php namespace Modules\User\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ResetRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'email' => 'required|email',
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
public function messages()
{
return [];
}
}
<?php namespace Modules\User\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class RolesRequest extends FormRequest
{
public function rules()
{
return [
'name' => 'required',
];
}
public function authorize()
{
return true;
}
public function messages()
{
return [];
}
}
<?php namespace Modules\User\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateUserRequest extends FormRequest
{
public function rules()
{
$userId = $this->route()->getParameter('users');
return [
'email' => "required|email|unique:users,email,{$userId}",
'first_name' => 'required',
'last_name' => 'required',
];
}
public function authorize()
{
return true;
}
public function messages()
{
return [];
}
}
<?php
use Illuminate\Routing\Router;
$router->group(['prefix' => LaravelLocalization::setLocale(), 'before' => 'LaravelLocalizationRedirectFilter|auth.admin|permissions'], function(Router $router)
{
$router->group(['prefix' => Config::get('core::core.admin-prefix'), 'namespace' => 'Modules\User\Http\Controllers'], function(Router $router)
{
$router->resource('users', 'Admin\UserController', ['except' => ['show'], 'names' => [
'index' => 'dashboard.user.index',
'create' => 'dashboard.user.create',
'store' => 'dashboard.user.store',
'edit' => 'dashboard.user.edit',
'update' => 'dashboard.user.update',
'destroy' => 'dashboard.user.destroy',
]]);
$router->resource('roles', 'Admin\RolesController', ['except' => ['show'], 'names' => [
'index' => 'dashboard.role.index',
'create' => 'dashboard.role.create',
'store' => 'dashboard.role.store',
'edit' => 'dashboard.role.edit',
'update' => 'dashboard.role.update',
'destroy' => 'dashboard.role.destroy',
]]);
});
});
$router->group(['prefix' => 'auth', 'namespace' => 'Modules\User\Http\Controllers'], function(Router $router)
{
# Login
$router->get('login', ['before' => 'auth.guest', 'as' => 'login', 'uses' => 'AuthController@getLogin']);
$router->post('login', array('as' => 'login.post', 'uses' => 'AuthController@postLogin'));
# Register
$router->get('register', ['before' => 'auth.guest', 'as' => 'register', 'uses' => 'AuthController@getRegister']);
$router->post('register', array('as' => 'register.post', 'uses' => 'AuthController@postRegister'));
# Account Activation
$router->get('activate/{userId}/{activationCode}', 'AuthController@getActivate');
# Reset password
$router->get('reset', ['as' => 'reset', 'uses' => 'AuthController@getReset']);
$router->post('reset', ['as' => 'reset.post', 'uses' => 'AuthController@postReset']);
$router->get('reset/{id}/{code}', ['as' => 'reset.complete', 'uses' => 'AuthController@getResetComplete']);
$router->post('reset/{id}/{code}', ['as' => 'reset.complete.post', 'uses' => 'AuthController@postResetComplete']);
# Logout
$router->get('logout', array('as' => 'logout', 'uses' => 'AuthController@getLogout'));
});
<?php namespace Modules\User\Listeners;
use Illuminate\Mail\Message;
use Illuminate\Support\Facades\Mail;
use Laracasts\Commander\Events\EventListener;
use Modules\User\Repositories\AuthenticationRepository;
class SendRegistrationConfirmationEmail extends EventListener
{
/**
* @var AuthenticationRepository
*/
private $auth;
public function __construct(AuthenticationRepository $auth)
{
$this->auth = $auth;
}
public function whenUserHasRegistered($event)
{
$user = $event->user;
$activation = $this->auth->createActivation($user);
$data = [
'user' => $user,
'activationcode' => $activation->code
];
Mail::queue('user::emails.welcome',$data,
function (Message $m) use ($user) {
$m->to($user->email)->subject('Welcome.');
}
);
}
}
<?php namespace Modules\User\Listeners;
use Illuminate\Mail\Message;
use Illuminate\Support\Facades\Mail;
use Laracasts\Commander\Events\EventListener;
class SendResetCodeEmail extends EventListener
{
public function whenUserHasBegunResetProcess($event)
{
$user = $event->user;
$code = $event->code;
Mail::queue('user::emails.reminder', compact('user', 'code'), function(Message $m) use ($user)
{
$m->to($user->email)->subject('Reset your account password.');
});
}
}
<?php namespace Modules\User\Presenters;
use Laracasts\Presenter\Presenter;
class UserPresenter extends Presenter
{
/**
* Return the gravatar link for the users email
* @param int $size
* @return string
*/
public function gravatar($size = 90)
{
$email = md5($this->email);
return "//www.gravatar.com/avatar/$email?s=$size";
}
public function fullname()
{
return $this->first_name . ' ' . $this->last_name;
}
}
<?php namespace Modules\User\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* The root namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $rootUrlNamespace = 'Modules\User\Http\Controllers';
/**
* The controllers to scan for route annotations.
*
* @var array
*/
protected $scan = [
'Modules\User\Http\Controllers',
];
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @param Router $router
* @return void
*/
public function before(Router $router)
{
//
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map(Router $router)
{
require __DIR__ . '/../Http/routes.php';
}
}
<?php namespace Modules\User\Providers;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
class UserServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* The filters base class name.
*
* @var array
*/
protected $filters = [
'Core' => [
'permissions' => 'PermissionFilter'
],
'User' => [
'auth.guest' => 'GuestFilter'
]
];
protected $middleware = [
'User' => [
'auth.guest' => 'GuestFilter'
]
];
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->booted(function ($app) {
$this->registerFilters($app['router']);
$this->registerMiddleware($app['router']);
$this->registerBindings();
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array();
}
/**
* Register the filters.
*
* @param Router $router
* @return void
*/
public function registerFilters(Router $router)
{
foreach ($this->filters as $module => $filters) {
foreach ($filters as $name => $filter) {
$class = "Modules\\{$module}\\Http\\Filters\\{$filter}";
$router->filter($name, $class);
}
}
}
private function registerBindings()
{
$this->app->bind(
'Modules\User\Repositories\UserRepository',
'Modules\User\Repositories\Sentry\SentryUserRepository'
);
$this->app->bind(
'Modules\User\Repositories\RoleRepository',
'Modules\User\Repositories\Sentry\SentryRoleRepository'
);
$this->app->bind(
'Modules\Core\Contracts\Authentication',
'Modules\User\Repositories\Sentry\SentryAuthentication'
);
}
private function registerMiddleware($router)
{
foreach ($this->middleware as $module => $middlewares) {
foreach ($middlewares as $name => $middleware) {
$class = "Modules\\{$module}\\Http\\Middleware\\{$middleware}";
$router->middleware($name, $class);
}
}
}
}
<?php namespace Modules\User\Repositories;
/**
* Interface RoleRepository
* @package Modules\User\Repositories
*/
interface RoleRepository
{
/**
* Return all the roles
* @return mixed
*/
public function all();
/**
* Create a role resource
* @return mixed
*/
public function create($data);
/**
* Find a role by its id
* @param $id
* @return mixed
*/
public function find($id);
/**
* Update a role
* @param $id
* @param $data
* @return mixed
*/
public function update($id, $data);
/**
* Delete a role
* @param $id
* @return mixed
*/
public function delete($id);
/**
* Find a role by its name
* @param string $name
* @return mixed
*/
public function findByName($name);
}
<?php namespace Modules\User\Repositories\Sentinel;
use Cartalyst\Sentinel\Checkpoints\NotActivatedException;
use Cartalyst\Sentinel\Checkpoints\ThrottlingException;
use Cartalyst\Sentinel\Laravel\Facades\Activation;
use Cartalyst\Sentinel\Laravel\Facades\Reminder;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Modules\Core\Contracts\Authentication;
class SentinelAuthentication implements Authentication
{
/**
* Authenticate a user
* @param array $credentials
* @param bool $remember Remember the user
* @return mixed
*/
public function login(array $credentials, $remember = false)
{
try {
if (Sentinel::authenticate($credentials, $remember)) {
return false;
}
return 'Invalid login or password.';
} catch (NotActivatedException $e) {
return 'Account not yet validated. Please check your email.';
} catch (ThrottlingException $e) {
$delay = $e->getDelay();
return "Your account is blocked for {$delay} second(s).";
}
}
/**
* Register a new user.
* @param array $user
* @return bool
*/
public function register(array $user)
{
return Sentinel::getUserRepository()->create((array) $user);
}
/**
* Assign a role to the given user.
* @param \Modules\User\Repositories\UserRepository $user
* @param \Modules\User\Repositories\RoleRepository $role
* @return mixed
*/
public function assignRole($user, $role)
{
return $role->users()->attach($user);
}
/**
* Log the user out of the application.
* @return bool
*/
public function logout()
{
return Sentinel::logout();
}
/**
* Activate the given used id
* @param int $userId
* @param string $code
* @return mixed
*/
public function activate($userId, $code)
{
$user = Sentinel::findById($userId);
return Activation::complete($user, $code);
}
/**
* Create an activation code for the given user
* @param \Modules\User\Repositories\UserRepository $user
* @return mixed
*/
public function createActivation($user)
{
return Activation::create($user);
}
/**
* Create a reminders code for the given user
* @param \Modules\User\Repositories\UserRepository $user
* @return mixed
*/
public function createReminderCode($user)
{
$reminder = Reminder::exists($user) ?: Reminder::create($user);
return $reminder->code;
}
/**
* Completes the reset password process
* @param $user
* @param string $code
* @param string $password
* @return bool
*/
public function completeResetPassword($user, $code, $password)
{
return Reminder::complete($user, $code, $password);
}
/**
* Determines if the current user has access to given permission
* @param $permission
* @return bool
*/
public function hasAccess($permission)
{
return Sentinel::hasAccess($permission);
}
/**
* Check if the user is logged in
* @return mixed
*/
public function check()
{
return Sentinel::check();
}
}
<?php namespace Modules\User\Repositories\Sentinel;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Modules\User\Repositories\RoleRepository;
class SentinelRoleRepository implements RoleRepository
{
/**
* @var \Cartalyst\Sentinel\Roles\EloquentRole
*/
protected $role;
public function __construct()
{
$this->role = Sentinel::getRoleRepository()->createModel();
}
/**
* Return all the roles
* @return mixed
*/
public function all()
{
return $this->role->all();
}
/**
* Create a role resource
* @return mixed
*/
public function create($data)
{
$this->role->create($data);
}
/**
* Find a role by its id
* @param $id
* @return mixed
*/
public function find($id)
{
return $this->role->find($id);
}
/**
* Update a role
* @param $id
* @param $data
* @return mixed
*/
public function update($id, $data)
{
$role = $this->role->find($id);
$role->fill($data);
$role->save();
}
/**
* Delete a role
* @param $id
* @return mixed
*/
public function delete($id)
{
$role = $this->role->find($id);
return $role->delete();
}
/**
* Find a role by its name
* @param string $name
* @return mixed
*/
public function findByName($name)
{
return Sentinel::findRoleByName($name);
}
}
<?php namespace Modules\User\Repositories\Sentinel;
use Cartalyst\Sentinel\Laravel\Facades\Activation;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Modules\User\Exceptions\UserNotFoundException;
use Modules\User\Repositories\UserRepository;
class SentinelUserRepository implements UserRepository
{
/**
* @var \Modules\User\Entities\User\Sentinel
*/
protected $user;
/**
* @var \Cartalyst\Sentinel\Roles\EloquentRole
*/
protected $role;
public function __construct()
{
$this->user = Sentinel::getUserRepository()->createModel();
$this->role = Sentinel::getRoleRepository()->createModel();
}
/**
* Returns all the users
* @return object
*/
public function all()
{
return $this->user->all();
}
/**
* Create a user resource
* @param $data
* @return mixed
*/
public function create(array $data)
{
return $this->user->create((array) $data);
}
/**
* Create a user and assign roles to it
* @param array $data
* @param array $roles
* @return void
*/
public function createWithRoles($data, $roles)
{
$user = $this->create((array) $data);
if (!empty($roles)) {
$user->roles()->attach($roles);
}
$activation = Activation::create($user);
Activation::complete($user, $activation->code);
}
/**
* Find a user by its ID
* @param $id
* @return mixed
*/
public function find($id)
{
return $this->user->find($id);
}
/**
* Update a user
* @param $user
* @param $data
* @return mixed
*/
public function update($user, $data)
{
return $this->user->update($user, $data);
}
/**
* @param $userId
* @param $data
* @param $roles
* @internal param $user
* @return mixed
*/
public function updateAndSyncRoles($userId, $data, $roles)
{
$user = $this->user->find($userId);
$user = $user->fill($data);
$user->save();
if (!empty($roles)) {
$user->roles()->sync($roles);
}
}
/**
* Deletes a user
* @param $id
* @throws UserNotFoundException
* @return mixed
*/
public function delete($id)
{
if ($user = $this->user->find($id)) {
return $user->delete();
};
throw new UserNotFoundException;
}
/**
* Find a user by its credentials
* @param array $credentials
* @return mixed
*/
public function findByCredentials(array $credentials)
{
return Sentinel::findByCredentials($credentials);
}
}
<?php namespace Modules\User\Repositories\Sentry;
use Cartalyst\Sentry\Throttling\UserBannedException;
use Cartalyst\Sentry\Throttling\UserSuspendedException;
use Cartalyst\Sentry\Users\LoginRequiredException;
use Cartalyst\Sentry\Users\PasswordRequiredException;
use Cartalyst\Sentry\Users\UserNotActivatedException;
use Cartalyst\Sentry\Users\UserNotFoundException;
use Cartalyst\Sentry\Users\WrongPasswordException;
use Modules\Core\Contracts\Authentication;
use Cartalyst\Sentry\Facades\Laravel\Sentry;
class SentryAuthentication implements Authentication
{
/**
* Authenticate a user
* @param array $credentials
* @param bool $remember Remember the user
* @return mixed
*/
public function login(array $credentials, $remember = false)
{
try
{
Sentry::authenticate($credentials, $remember);
return false;
}
catch (LoginRequiredException $e)
{
return 'Login field is required.';
}
catch (PasswordRequiredException $e)
{
return 'Password field is required.';
}
catch (WrongPasswordException $e)
{
return 'Wrong password, try again.';
}
catch (UserNotFoundException $e)
{
return 'User was not found.';
}
catch (UserNotActivatedException $e)
{
return 'User is not activated.';
}
catch (UserSuspendedException $e)
{
return 'User is suspended.';
}
catch (UserBannedException $e)
{
return 'User is banned.';
}
}
/**
* Register a new user.
* @param array $user
* @return bool
*/
public function register(array $user)
{
return Sentry::register($user);
}
/**
* Activate the given used id
* @param int $userId
* @param string $code
* @return mixed
*/
public function activate($userId, $code)
{
$user = Sentry::findUserById($userId);
return $user->attemptActivation($code);
}
/**
* Assign a role to the given user.
* @param \Modules\User\Repositories\UserRepository $user
* @param \Modules\User\Repositories\RoleRepository $role
* @return mixed
*/
public function assignRole($user, $role)
{
return $role->users()->attach($user);
}
/**
* Log the user out of the application.
* @return mixed
*/
public function logout()
{
return Sentry::logout();
}
/**
* Create an activation code for the given user
* @param $user
* @return mixed
*/
public function createActivation($user)
{
return $user->getResetPasswordCode();
}
/**
* Create a reminders code for the given user
* @param $user
* @return mixed
*/
public function createReminderCode($user)
{
return $user->getResetPasswordCode();
}
/**
* Completes the reset password process
* @param $user
* @param string $code
* @param string $password
* @return bool
*/
public function completeResetPassword($user, $code, $password)
{
return $user->attemptResetPassword($code, $password);
}
/**
* Determines if the current user has access to given permission
* @param $permission
* @return bool
*/
public function hasAccess($permission)
{
return Sentry::hasAccess($permission);
}
/**
* Check if the user is logged in
* @return mixed
*/
public function check()
{
if (Sentry::check()) {
return Sentry::getUser();
}
return false;
}
}
<?php namespace Modules\User\Repositories\Sentry;
use Modules\User\Repositories\RoleRepository;
use Cartalyst\Sentry\Facades\Laravel\Sentry;
class SentryRoleRepository implements RoleRepository
{
/**
* Return all the roles
* @return mixed
*/
public function all()
{
return Sentry::findAllGroups();
}
/**
* Create a role resource
* @return mixed
*/
public function create($data)
{
unset($data['slug']);
Sentry::createGroup($data);
}
/**
* Find a role by its id
* @param $id
* @return mixed
*/
public function find($id)
{
return Sentry::findGroupById($id);
}
/**
* Update a role
* @param $id
* @param $data
* @return mixed
*/
public function update($id, $data)
{
unset($data['slug']);
$role = Sentry::findGroupById($id);
$role->update($data);
}
/**
* Delete a role
* @param $id
* @return mixed
*/
public function delete($id)
{
$role = Sentry::findGroupById($id);
return $role->delete();
}
/**
* Find a role by its name
* @param string $name
* @return mixed
*/
public function findByName($name)
{
return Sentry::findGroupByName($name);
}
}
<?php namespace Modules\User\Repositories\Sentry;
use Modules\User\Repositories\UserRepository;
use Cartalyst\Sentry\Facades\Laravel\Sentry;
use Cartalyst\Sentry\Users\UserNotFoundException;
class SentryUserRepository implements UserRepository
{
/**
* Returns all the users
* @return object
*/
public function all()
{
return Sentry::findAllUsers();
}
/**
* Create a user resource
* @param array $data
* @return mixed
*/
public function create(array $data)
{
return Sentry::createUser($data);
}
/**
* Create a user and assign roles to it
* @param array $data
* @param array $roles
* @param bool $activated
*/
public function createWithRoles($data, $roles, $activated = false)
{
$user = Sentry::createUser(array_merge($data, ['activated' => $activated]));
if (!empty($roles)) {
foreach ($roles as $roleId) {
$group = Sentry::findGroupById($roleId);
$user->addGroup($group);
}
}
}
/**
* Find a user by its ID
* @param $id
* @return mixed
*/
public function find($id)
{
return Sentry::findUserById($id);
}
/**
* Update a user
* @param $user
* @param $data
* @return mixed
*/
public function update($user, $data)
{
$user = $user->update($data);
return $user->save();
}
/**
* Update a user and sync its roles
* @param int $userId
* @param $data
* @param $roles
* @return mixed
*/
public function updateAndSyncRoles($userId, $data, $roles)
{
$user = Sentry::findUserById($userId);
$user->update($data);
if (!empty($roles)) {
// Get the user roles
$userRoles = $user->groups()->get()->toArray();
$cleanedRoles = [];
foreach ($userRoles as $role) {
$cleanedRoles[$role['id']] = $role;
}
// Set the new roles
foreach ($roles as $roleId) {
if (isset($cleanedRoles[$roleId])) {
unset($cleanedRoles[$roleId]);
}
$group = Sentry::findGroupById($roleId);
$user->addGroup($group);
}
// Unset the unchecked roles
foreach ($cleanedRoles as $roleId => $role) {
$group = Sentry::findGroupById($roleId);
$user->removeGroup($group);
}
}
}
/**
* Deletes a user
* @param $id
* @return mixed
* @throws UserNotFoundException
*/
public function delete($id)
{
if ($user = Sentry::findUserById($id)) {
return $user->delete();
};
throw new UserNotFoundException;
}
/**
* Find a user by its credentials
* @param array $credentials
* @return mixed
*/
public function findByCredentials(array $credentials)
{
return Sentry::findUserByCredentials($credentials);
}
}
<?php namespace Modules\User\Repositories;
/**
* Interface UserRepository
* @package Modules\User\Repositories
*/
interface UserRepository
{
/**
* Returns all the users
* @return object
*/
public function all();
/**
* Create a user resource
* @param array $data
* @return mixed
*/
public function create(array $data);
/**
* Create a user and assign roles to it
* @param array $data
* @param array $roles
* @return void
*/
public function createWithRoles($data, $roles);
/**
* Find a user by its ID
* @param $id
* @return mixed
*/
public function find($id);
/**
* Update a user
* @param $user
* @param $data
* @return mixed
*/
public function update($user, $data);
/**
* Update a user and sync its roles
* @param int $userId
* @param $data
* @param $roles
* @return mixed
*/
public function updateAndSyncRoles($userId, $data, $roles);
/**
* Deletes a user
* @param $id
* @return mixed
*/
public function delete($id);
/**
* Find a user by its credentials
* @param array $credentials
* @return mixed
*/
public function findByCredentials(array $credentials);
}
<?php
return [
'cancel' => 'Cancel',
'delete' => 'Delete',
'create' => 'Create',
'update' => 'Update',
];
<?php
return [
/* Authentication */
'successfully logged in' => 'Successfully logged in',
'account created check email for activation' => 'Account created. Please check your email to activate your account.',
'account activated you can now login' => 'Account activated. You can now login.',
'there was an error with the activation' => 'There was an error with the activation.',
'no user found' => 'No user with that email address belongs in our system.',
'check email to reset password' => 'Check your email to reset your password.',
'user no longer exists' => 'The user no longer exists.',
'invalid reset code' => 'Invalid or expired reset code.',
'password reset' => 'Password has been reset. You can now login with your new password.',
/* User management */
'user created' => 'User successfully created.',
'user not found' => 'User not found.',
'user updated' => 'User successfully updated.',
'user deleted' => 'User successfully deleted.',
/* Role management */
'role created' => 'Role successfully created.',
'role not found' => 'Role not found.',
'role updated' => 'Role successfully updated.',
'role deleted' => 'Role successfully deleted.',
];
<?php
return [
'button' => [
'new-role'=> 'New role'
],
'title' => [
'roles' => 'Roles',
'edit' => 'Edit role',
'users-with-roles' => 'Users with this role',
],
'breadcrumb' => [
'roles' => 'Roles',
'new' => 'New',
'edit' => 'Edit role',
],
'table' => [
'name' => 'Name'
],
'tabs' => [
'data' => 'Data',
'permissions' => 'Permissions'
],
'form' => [
'name' => 'Role name',
'slug' => 'Role slug'
],
];
<?php
return [
'button' => [
'new-user' => 'New User',
],
'title' => [
'users' => 'Users',
'new-user' => 'New user',
'edit-user' => 'Edit user',
],
'breadcrumb' => [
'home' => 'Home',
'users' => 'Users',
'new' => 'New',
'edit-user' => 'Edit user',
],
'tabs' => [
'data' => 'Data',
'roles' => 'Roles',
'permissions' => 'Permissions',
],
'form' => [
'first-name' => 'First name',
'last-name' => 'Last name',
'email' => 'Email',
'password' => 'Password',
'password-confirmation' => 'Password confirmation',
],
'table' => [
'created-at' => 'Created At',
'first-name' => 'First name',
'last-name' => 'Last name',
'email' => 'Email',
'actions' => 'Actions',
]
];
<?php
return [
'cancel' => 'Annuler',
'delete' => 'Suprimmer',
'create' => 'Créer',
'update' => 'Mise à jour',
];
<?php
return [
/* Authentication */
'successfully logged in' => 'Authentification réussie',
'account created check email for activation' => 'Compte créer. Contrôller vos emails pour activer votre compte.',
'account activated you can now login' => 'Compte activer. Vous pouvez désaprésent vous authentifier.',
'there was an error with the activation' => 'Une erreur s\'est produite pendant l\'activation',
'no user found' => 'Aucun utilisateur ne correspond a cette addresse email.',
'check email to reset password' => 'Contrôller vos emails pour réinitialiser votre mot de passe.',
'user no longer exists' => 'Cet utilisateur n\'existe plus.',
'invalid reset code' => 'Code de réinitialisation non valide ou expirer.',
'password reset' => 'Mot de passe réinitialiser. Vous pouvez vous authentifier avec votre nouveau mot de passe.',
/* User management */
'user created' => 'Utilisateur créer.',
'user not found' => 'Utilisateur non trouvé.',
'user updated' => 'Utilisateur mit à jour.',
'user deleted' => 'Utilisateur suprimer',
/* Role management */
'role created' => 'Role créer.',
'role not found' => 'Role non trouvé.',
'role updated' => 'Role mit à jour.',
'role deleted' => 'Role suprimer',
];
<?php
return [
'button' => [
'new-role'=> 'Nouveau rôle'
],
'title' => [
'roles' => 'Rôles',
'edit' => 'Editez un rôle',
'users-with-roles' => 'Utilisateurs avec ce rôle',
],
'breadcrumb' => [
'roles' => 'Rôles',
'new' => 'Nouveau',
'edit' => 'Editez un rôle',
],
'table' => [
'name' => 'Nom'
],
'tabs' => [
'data' => 'Données',
'permissions' => 'Permissions',
],
'form' => [
'name' => 'Nom du rôle',
'slug' => 'Slug du rôle'
],
];
<?php
return [
'button' => [
'new-user' => 'Nouvel utilisateur',
],
'title' => [
'users' => 'Utilisateurs',
'new-user' => 'Nouvel utilisateur',
'edit-user' => 'Edition d\'utilisateur',
],
'breadcrumb' => [
'home' => 'Accueil',
'users' => 'Utilisateurs',
'new' => 'Nouveau',
'edit-user' => 'Edition d\'utilisateur',
],
'tabs' => [
'data' => 'Données',
'roles' => 'Rôles',
'permissions' => 'Permissions',
],
'form' => [
'first-name' => 'Prénom',
'last-name' => 'Nom de famille',
'email' => 'Adresse email',
'password' => 'Mot de passe',
'password-confirmation' => 'Confirmation de mot de passe',
],
'table' => [
'created-at' => 'Crée à',
'first-name' => 'Prénom',
'last-name' => 'Nom de famille',
'email' => 'Email',
'actions' => 'Actions',
]
];
<div class="box-body">
<div class="row">
<div class="col-md-12">
<?php foreach($permissions as $name => $value): ?>
<h3>{{ $name }} Module</h3>
<?php foreach($value as $subPermissionTitle => $permissionName): ?>
<h4>{{ ucfirst($subPermissionTitle) }}</h4>
<?php foreach($permissionName as $permissionAction): ?>
<div class="checkbox">
<label for="<?php echo "$subPermissionTitle.$permissionAction" ?>">
<input id="<?php echo "$subPermissionTitle.$permissionAction" ?>" name="permissions[<?php echo "$subPermissionTitle.$permissionAction" ?>]" type="checkbox" class="flat-blue" value="true" /> {{ ucfirst($permissionAction) }}
</label>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</div>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-12">
<?php foreach($permissions as $name => $value): ?>
<h3>{{ $name }} Module</h3>
<?php foreach($value as $subPermissionTitle => $permissionName): ?>
<h4>{{ ucfirst($subPermissionTitle) }}</h4>
<?php foreach($permissionName as $permissionAction): ?>
<div class="checkbox">
<label for="<?php echo "$subPermissionTitle.$permissionAction" ?>">
<input id="<?php echo "$subPermissionTitle.$permissionAction" ?>" name="permissions[<?php echo "$subPermissionTitle.$permissionAction" ?>]" type="checkbox" class="flat-blue" <?php echo $model->hasAccess("$subPermissionTitle.$permissionAction") ? 'checked' : '' ?> value="true" /> {{ ucfirst($permissionAction) }}
</label>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</div>
</div>
@extends('core::layouts.master')
@section('content-header')
<h1>New Role</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('core::core.breadcrumb.home') }}</a></li>
<li class=""><a href="{{ URL::route('dashboard.role.index') }}">{{ trans('user::roles.breadcrumb.roles') }}</a></li>
<li class="active">{{ trans('user::roles.breadcrumb.new') }}</li>
</ol>
@stop
@section('styles')
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
{!! Form::open(['route' => 'dashboard.role.store', 'method' => 'post']) !!}
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_1-1" data-toggle="tab">{{ trans('user::roles.tabs.data') }}</a></li>
<li class=""><a href="#tab_2-2" data-toggle="tab">{{ trans('user::roles.tabs.permissions') }}</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_1-1">
<div class="box-body">
<div class="row">
<div class="col-sm-6">
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
{!! Form::label('name', trans('user::roles.form.name')) !!}
{!! Form::text('name', Input::old('name'), ['class' => 'form-control slugify', 'placeholder' => trans('user::roles.form.name')]) !!}
{!! $errors->first('name', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="col-sm-6">
<div class="form-group{{ $errors->has('slug') ? ' has-error' : '' }}">
{!! Form::label('slug', trans('user::roles.form.slug')) !!}
{!! Form::text('slug', Input::old('slug'), ['class' => 'form-control slug', 'placeholder' => trans('user::roles.form.slug')]) !!}
{!! $errors->first('slug', '<span class="help-block">:message</span>') !!}
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tab_2-2">
@include('user::admin.partials.permissions-create')
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary btn-flat">{{ trans('user::button.create') }}</button>
<a class="btn btn-danger pull-right btn-flat" href="{{ URL::route('dashboard.role.index')}}"><i class="fa fa-times"></i> {{ trans('user::button.cancel') }}</a>
</div>
</div>
</div>
</div>
</div>
{!! Form::close() !!}
@stop
@section('scripts')
<script>
$( document ).ready(function() {
$('input[type="checkbox"].flat-blue, input[type="radio"].flat-blue').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat-blue'
});
});
</script>
@stop
@extends('core::layouts.master')
@section('content-header')
<h1>
{{ trans('user::roles.title.edit') }} <small>{{ $role->name }}</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('core::core.breadcrumb.home') }}</a></li>
<li class=""><a href="{{ URL::route('dashboard.role.index') }}">{{ trans('user::roles.breadcrumb.roles') }}</a></li>
<li class="active">{{ trans('user::roles.breadcrumb.edit') }}</li>
</ol>
@stop
@section('styles')
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
{!! Form::open(['route' => ['dashboard.role.update', $role->id], 'method' => 'put']) !!}
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_1-1" data-toggle="tab">{{ trans('user::roles.tabs.data') }}</a></li>
<li class=""><a href="#tab_2-2" data-toggle="tab">{{ trans('user::roles.tabs.permissions') }}</a></li>
<li class=""><a href="#tab_3-3" data-toggle="tab">{{ trans('user::users.title.users') }}</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_1-1">
<div class="box-body">
<div class="row">
<div class="col-sm-6">
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
{!! Form::label('name', trans('user::roles.form.name')) !!}
{!! Form::text('name', Input::old('name', $role->name), ['class' => 'form-control slugify', 'placeholder' => trans('user::roles.form.name')]) !!}
{!! $errors->first('name', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="col-sm-6">
<div class="form-group{{ $errors->has('slug') ? ' has-error' : '' }}">
{!! Form::label('slug', trans('user::roles.form.slug')) !!}
{!! Form::text('slug', Input::old('slug', $role->slug), ['class' => 'form-control slug', 'placeholder' => trans('user::roles.form.slug')]) !!}
{!! $errors->first('slug', '<span class="help-block">:message</span>') !!}
</div>
</div>
</div>
</div>
</div><!-- /.tab-pane -->
<div class="tab-pane" id="tab_2-2">
@include('user::admin.partials.permissions', ['model' => $role])
</div><!-- /.tab-pane -->
<div class="tab-pane" id="tab_3-3">
<div class="box-body">
<div class="row">
<div class="col-md-12">
<h3>{{ trans('user::roles.title.users-with-roles') }}</h3>
<ul>
<?php foreach($role->users()->get() as $user): ?>
<li>
<a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}">{{ $user->present()->fullname() }}</a>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary btn-flat">{{ trans('user::button.update') }}</button>
<a class="btn btn-danger pull-right btn-flat" href="{{ URL::route('dashboard.role.index')}}"><i class="fa fa-times"></i> {{ trans('user::button.cancel') }}</a>
</div>
</div><!-- /.tab-content -->
</div>
</div>
</div>
{!! Form::close() !!}
@stop
@section('scripts')
<script>
$( document ).ready(function() {
$('input[type="checkbox"].flat-blue, input[type="radio"].flat-blue').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat-blue'
});
});
</script>
@stop
@extends('core::layouts.master')
@section('content-header')
<h1>
{{ trans('user::roles.title.roles') }}
</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('core::core.breadcrumb.home') }}</a></li>
<li class="active">{{ trans('user::roles.breadcrumb.roles') }}</li>
</ol>
@stop
@section('content')
<div class="row">
<div class="col-xs-12">
<div class="row">
<div class="btn-group pull-right" style="margin: 0 15px 15px 0;">
<a href="{{ URL::route('dashboard.role.create') }}" class="btn btn-primary btn-flat" style="padding: 4px 10px;">
<i class="fa fa-pencil"></i> {{ trans('user::roles.button.new-role') }}
</a>
</div>
</div>
<div class="box box-info">
<div class="box-header">
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<table class="data-table table table-bordered table-hover">
<thead>
<tr>
<th>{{ trans('user::users.table.created-at') }}</th>
<th>{{ trans('user::roles.table.name') }}</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php if (isset($roles)): ?>
<?php foreach($roles as $role): ?>
<tr>
<td>
<a href="{{ URL::route('dashboard.role.edit', [$role->id]) }}">
{{ $role->created_at }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.role.edit', [$role->id]) }}">
{{ $role->name }}
</a>
</td>
<td>
<div class="btn-group">
<a href="{{ URL::route('dashboard.role.edit', [$role->id]) }}" class="btn btn-default btn-flat"><i class="glyphicon glyphicon-pencil"></i></a>
<button class="btn btn-danger btn-flat" data-toggle="modal" data-target="#confirmation-{{ $role->id }}"><i class="glyphicon glyphicon-trash"></i></button>
</div>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
<th>{{ trans('user::users.table.created-at') }}</th>
<th>{{ trans('user::roles.table.name') }}</th>
<th>Actions</th>
</tr>
</tfoot>
</table>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col (MAIN) -->
</div>
</div>
<?php if (isset($roles)): ?>
<?php foreach($roles as $role): ?>
<!-- Modal -->
<div class="modal fade" id="confirmation-{{ $role->id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">{{ trans('core::core.modal.title') }}</h4>
</div>
<div class="modal-body">
{{ trans('core::core.modal.confirmation-message') }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('core::core.button.cancel') }}</button>
{!! Form::open(['route' => ['dashboard.role.destroy', $role->id], 'method' => 'delete', 'class' => 'pull-left']) !!}
<button type="submit" class="btn btn-danger btn-flat"><i class="glyphicon glyphicon-trash"></i> {{ trans('core::core.button.delete') }}</button>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
@stop
@section('scripts')
<?php $locale = App::getLocale(); ?>
<script type="text/javascript">
$(function () {
$('.data-table').dataTable({
"paginate": true,
"lengthChange": true,
"filter": true,
"sort": true,
"info": true,
"autoWidth": true,
"order": [[ 0, "desc" ]],
"language": {
"url": '<?php echo Module::asset("core:js/vendor/datatables/{$locale}.json") ?>'
},
"columns": [
null,
null,
{ "sortable": false }
]
});
});
</script>
@stop
@extends('core::layouts.master')
@section('content-header')
<h1>
{{ trans('user::users.title.new-user') }}
</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('core::core.breadcrumb.home') }}</a></li>
<li class=""><a href="{{ URL::route('dashboard.user.index') }}">{{ trans('user::users.breadcrumb.users') }}</a></li>
<li class="active">{{ trans('user::users.breadcrumb.new') }}</li>
</ol>
@stop
@section('styles')
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
{!! Form::open(['route' => 'dashboard.user.store', 'method' => 'post']) !!}
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_1-1" data-toggle="tab">{{ trans('user::users.tabs.data') }}</a></li>
<li class=""><a href="#tab_2-2" data-toggle="tab">{{ trans('user::users.tabs.roles') }}</a></li>
<li class=""><a href="#tab_3-3" data-toggle="tab">{{ trans('user::users.tabs.permissions') }}</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_1-1">
<div class="box-body">
<div class="row">
<div class="col-sm-4">
<div class="form-group{{ $errors->has('first_name') ? ' has-error' : '' }}">
{!! Form::label('first_name', trans('user::users.form.first-name')) !!}
{!! Form::text('first_name', Input::old('first_name'), ['class' => 'form-control', 'placeholder' => trans('user::users.form.first-name')]) !!}
{!! $errors->first('first_name', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="col-sm-4">
<div class="form-group{{ $errors->has('last_name') ? ' has-error' : '' }}">
{!! Form::label('last_name', trans('user::users.form.last-name')) !!}
{!! Form::text('last_name', Input::old('last_name'), ['class' => 'form-control', 'placeholder' => trans('user::users.form.last-name')]) !!}
{!! $errors->first('last_name', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="col-sm-4">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
{!! Form::label('email', trans('user::users.form.email')) !!}
{!! Form::email('email', Input::old('email'), ['class' => 'form-control', 'placeholder' => trans('user::users.form.email')]) !!}
{!! $errors->first('email', '<span class="help-block">:message</span>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
{!! Form::label('password', trans('user::users.form.password')) !!}
{!! Form::password('password', ['class' => 'form-control']) !!}
{!! $errors->first('password', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="col-sm-6">
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
{!! Form::label('password_confirmation', trans('user::users.form.password-confirmation')) !!}
{!! Form::password('password_confirmation', ['class' => 'form-control']) !!}
{!! $errors->first('password_confirmation', '<span class="help-block">:message</span>') !!}
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tab_2-2">
<div class="box-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>{{ trans('user::users.tabs.roles') }}</label>
<select multiple="" class="form-control" name="roles[]">
<?php foreach($roles as $role): ?>
<option value="{{ $role->id }}">{{ $role->name }}</option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tab_3-3">
<div class="box-body">
@include('user::admin.partials.permissions-create')
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary btn-flat">{{ trans('user::button.create') }}</button>
<a class="btn btn-danger pull-right btn-flat" href="{{ URL::route('dashboard.user.index')}}"><i class="fa fa-times"></i> {{ trans('user::button.cancel') }}</a>
</div>
</div>
</div>
</div>
</div>
{!! Form::close() !!}
@stop
@section('scripts')
<script>
$( document ).ready(function() {
$('input[type="checkbox"].flat-blue, input[type="radio"].flat-blue').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat-blue'
});
});
</script>
@stop
@extends('core::layouts.master')
@section('content-header')
<h1>
{{ trans('user::users.title.edit-user') }} <small>{{ $user->present()->fullname() }}</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('core::core.breadcrumb.home') }}</a></li>
<li class=""><a href="{{ URL::route('dashboard.user.index') }}">{{ trans('user::users.breadcrumb.users') }}</a></li>
<li class="active">{{ trans('user::users.breadcrumb.edit-user') }}</li>
</ol>
@stop
@section('styles')
<link href="{{{ Module::asset('core:css/vendor/iCheck/flat/blue.css') }}}" rel="stylesheet" type="text/css" />
@stop
@section('content')
{!! Form::open(['route' => ['dashboard.user.update', $user->id], 'method' => 'put']) !!}
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_1-1" data-toggle="tab">{{ trans('user::users.tabs.data') }}</a></li>
<li class=""><a href="#tab_2-2" data-toggle="tab">{{ trans('user::users.tabs.roles') }}</a></li>
<li class=""><a href="#tab_3-3" data-toggle="tab">{{ trans('user::users.tabs.permissions') }}</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_1-1">
<div class="box-body">
<div class="row">
<div class="col-sm-4">
<div class="form-group{{ $errors->has('first_name') ? ' has-error' : '' }}">
{!! Form::label('first_name', trans('user::users.form.first-name')) !!}
{!! Form::text('first_name', Input::old('first_name', $user->first_name), ['class' => 'form-control', 'placeholder' => trans('user::users.form.first-name')]) !!}
{!! $errors->first('first_name', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="col-sm-4">
<div class="form-group{{ $errors->has('last_name') ? ' has-error' : '' }}">
{!! Form::label('last_name', trans('user::users.form.last-name')) !!}
{!! Form::text('last_name', Input::old('last_name', $user->last_name), ['class' => 'form-control', 'placeholder' => trans('user::users.form.last-name')]) !!}
{!! $errors->first('last_name', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="col-sm-4">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
{!! Form::label('email', trans('user::users.form.email')) !!}
{!! Form::email('email', Input::old('email', $user->email), ['class' => 'form-control', 'placeholder' => trans('user::users.form.email')]) !!}
{!! $errors->first('email', '<span class="help-block">:message</span>') !!}
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tab_2-2">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>{{ trans('user::users.tabs.roles') }}</label>
<select multiple="" class="form-control" name="roles[]">
<?php foreach($roles as $role): ?>
<option value="{{ $role->id }}" <?php echo $user->hasRole($role->id) ? 'selected' : '' ?>>{{ $role->name }}</option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tab_3-3">
<div class="box-body">
@include('user::admin.partials.permissions', ['model' => $user])
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary btn-flat">{{ trans('user::button.update') }}</button>
<a class="btn btn-danger pull-right btn-flat" href="{{ URL::route('dashboard.user.index')}}"><i class="fa fa-times"></i> {{ trans('user::button.cancel') }}</a>
</div>
</div>
</div>
</div>
</div>
{!! Form::close() !!}
@stop
@section('scripts')
<script>
$( document ).ready(function() {
$('input[type="checkbox"].flat-blue, input[type="radio"].flat-blue').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat-blue'
});
});
</script>
@stop
@extends('core::layouts.master')
@section('content-header')
<h1>
{{ trans('user::users.title.users') }}
</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('core::core.breadcrumb.home') }}</a></li>
<li class="active">{{ trans('user::users.breadcrumb.users') }}</li>
</ol>
@stop
@section('content')
<div class="row">
<div class="col-xs-12">
<div class="row">
<div class="btn-group pull-right" style="margin: 0 15px 15px 0;">
<a href="{{ URL::route('dashboard.user.create') }}" class="btn btn-primary btn-flat" style="padding: 4px 10px;">
<i class="fa fa-pencil"></i> {{ trans('user::users.button.new-user') }}
</a>
</div>
</div>
<div class="box box-info">
<div class="box-header">
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<table class="data-table table table-bordered table-hover">
<thead>
<tr>
<th>{{ trans('user::users.table.created-at') }}</th>
<th>{{ trans('user::users.table.first-name') }}</th>
<th>{{ trans('user::users.table.last-name') }}</th>
<th>{{ trans('user::users.table.email') }}</th>
<th>{{ trans('user::users.table.actions') }}</th>
</tr>
</thead>
<tbody>
<?php if (isset($users)): ?>
<?php foreach($users as $user): ?>
<tr>
<td>
<a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}">
{{ $user->created_at }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}">
{{ $user->first_name }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}">
{{ $user->last_name }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}">
{{ $user->email }}
</a>
</td>
<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 != $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>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
<th>{{ trans('user::users.table.created-at') }}</th>
<th>{{ trans('user::users.table.first-name') }}</th>
<th>{{ trans('user::users.table.last-name') }}</th>
<th>{{ trans('user::users.table.email') }}</th>
<th>{{ trans('user::users.table.actions') }}</th>
</tr>
</tfoot>
</table>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col (MAIN) -->
</div>
</div>
<?php if (isset($users)): ?>
<?php foreach($users as $user): ?>
<!-- Modal -->
<div class="modal fade" id="confirmation-{{ $user->id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">{{ trans('core::core.modal.title') }}</h4>
</div>
<div class="modal-body">
{{ trans('core::core.modal.confirmation-message') }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('core::core.button.cancel') }}</button>
{!! Form::open(['route' => ['dashboard.user.destroy', $user->id], 'method' => 'delete', 'class' => 'pull-left']) !!}
<button type="submit" class="btn btn-danger btn-flat"><i class="glyphicon glyphicon-trash"></i> {{ trans('core::core.button.delete') }}</button>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
@stop
@section('scripts')
<?php $locale = App::getLocale(); ?>
<script type="text/javascript">
$(function () {
$('.data-table').dataTable({
"paginate": true,
"lengthChange": true,
"filter": true,
"sort": true,
"info": true,
"autoWidth": true,
"order": [[ 0, "desc" ]],
"language": {
"url": '<?php echo Module::asset("core:js/vendor/datatables/{$locale}.json") ?>'
},
"columns": [
null,
null,
null,
null,
{ "sortable": false }
]
});
});
</script>
@stop
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SocialDashy - Reset password</title>
<style type="text/css">
img {
max-width: 100%;
}
body {
-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6;
}
body {
background-color: #f6f6f6;
}
@media only screen and (max-width: 640px) {
h1 {
font-weight: 600 !important; margin: 20px 0 5px !important;
}
h2 {
font-weight: 600 !important; margin: 20px 0 5px !important;
}
h3 {
font-weight: 600 !important; margin: 20px 0 5px !important;
}
h4 {
font-weight: 600 !important; margin: 20px 0 5px !important;
}
h1 {
font-size: 22px !important;
}
h2 {
font-size: 18px !important;
}
h3 {
font-size: 16px !important;
}
.container {
width: 100% !important;
}
.content {
padding: 10px !important;
}
.content-wrapper {
padding: 10px !important;
}
.invoice {
width: 100% !important;
}
}
</style>
</head>
<body style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6; background: #f6f6f6; margin: 0; padding: 0;">
<table class="body-wrap" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background: #f6f6f6; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0;" valign="top"></td>
<td class="container" width="600" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto; padding: 0;" valign="top">
<div class="content" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
<table class="main" width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background: #fff; margin: 0; padding: 0; border: 1px solid #e9e9e9;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-wrap" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;" valign="top">
<table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 20px; font-weight:bold; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
SocialDashy - Password Reset
</td>
</tr>
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
To reset your password, complete this form: {{ URL::to("auth/reset/{$user['id']}/{$code}") }}.
</td>
</tr>
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
<a href='{{ URL::to("reset/{$user['id']}/{$code}") }}' class="btn-primary" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background: #348eda; margin: 0; padding: 0; border-color: #348eda; border-style: solid; border-width: 10px 20px;">Reset Password</a>
</td>
</tr>
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
&mdash; The SocialDashy team
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="footer" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
<table width="100%" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
</table>
</div></div>
</td>
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0;" valign="top"></td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Welcome</title>
<style type="text/css">
img {
max-width: 100%;
}
body {
-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6;
}
body {
background-color: #f6f6f6;
}
@media only screen and (max-width: 640px) {
h1 {
font-weight: 600 !important; margin: 20px 0 5px !important;
}
h2 {
font-weight: 600 !important; margin: 20px 0 5px !important;
}
h3 {
font-weight: 600 !important; margin: 20px 0 5px !important;
}
h4 {
font-weight: 600 !important; margin: 20px 0 5px !important;
}
h1 {
font-size: 22px !important;
}
h2 {
font-size: 18px !important;
}
h3 {
font-size: 16px !important;
}
.container {
width: 100% !important;
}
.content {
padding: 10px !important;
}
.content-wrapper {
padding: 10px !important;
}
.invoice {
width: 100% !important;
}
}
</style>
</head>
<body style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6; background: #f6f6f6; margin: 0; padding: 0;">
<table class="body-wrap" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background: #f6f6f6; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0;" valign="top"></td>
<td class="container" width="600" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto; padding: 0;" valign="top">
<div class="content" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
<table class="main" width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background: #fff; margin: 0; padding: 0; border: 1px solid #e9e9e9;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-wrap" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;" valign="top">
<table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 20px; font-weight:bold; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
Welcome
</td>
</tr>
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
Please confirm your email address by clicking the link below.
</td>
</tr>
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
We may need to send you critical information about our service and it is important that we have an accurate email address.
</td>
</tr>
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
<a href="{{ URL::to('auth/activate/' . $user['id'] . '/' . $activationcode) }}" class="btn-primary" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background: #348eda; margin: 0; padding: 0; border-color: #348eda; border-style: solid; border-width: 10px 20px;">Confirm email address</a>
</td>
</tr>
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
&mdash; The team,
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="footer" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
<table width="100%" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
</table>
</div></div>
</td>
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0;" valign="top"></td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html class="bg-black">
<head>
<meta charset="UTF-8">
<title>
@section('title')
Website
@show
</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<!-- bootstrap 3.0.2 -->
<link href="{{{ Module::asset('core:css/vendor/bootstrap.min.css') }}}" rel="stylesheet" type="text/css" />
<!-- font Awesome -->
<link href="{{{ Module::asset('core:css/vendor/font-awesome.min.css') }}}" rel="stylesheet" type="text/css" />
<!-- Ionicons -->
<link href="{{{ Module::asset('core:css/vendor/ionicons.min.css') }}}" rel="stylesheet" type="text/css" />
<!-- Theme style -->
<link href="{{{ Module::asset('core:css/AdminLTE.css') }}}" rel="stylesheet" type="text/css" />
<link href="{{{ Module::asset('core:css/vendor/alertify/alertify.core.css') }}}" rel="stylesheet" type="text/css" />
<link href="{{{ Module::asset('core:css/vendor/alertify/alertify.default.css') }}}" rel="stylesheet" type="text/css" />
<script src="{{{ Module::asset('core:js/vendor/jquery.min.js') }}}"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body class="bg-black">
<div class="form-box" id="login-box">
@yield('content')
</div>
<!-- Bootstrap -->
<script src="{{{ Module::asset('core:js/vendor/bootstrap.min.js') }}}" type="text/javascript"></script>
<script src="{{{ Module::asset('core:js/vendor/alertify/alertify.js') }}}" type="text/javascript"></script>
</body>
</html>
@extends('user::layouts.account')
@section('title')
Login | @parent
@stop
@section('content')
<div class="header">Sign In</div>
@include('flash::message')
{!! Form::open(array('route' => 'login.post')) !!}
<div class="body bg-gray">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<input type="email" name="email" class="form-control"
placeholder="Email" value="{{ Input::old('email')}}"/>
{!! $errors->first('email', '<span class="help-block">:message</span>') !!}
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<input type="password" name="password"
class="form-control" placeholder="Password"
value="{{ Input::old('password')}}"/>
{!! $errors->first('password', '<span class="help-block">:message</span>') !!}
</div>
<div class="form-group">
<input type="checkbox" name="remember_me" id="remember_me"/> <label for="remember_me">Remember me</label>
</div>
</div>
<div class="footer">
<button type="submit" class="btn btn-info btn-block">Sign me in</button>
<p><a href="{{URL::route('reset')}}">I forgot my password</a></p>
<a href="{{URL::route('register')}}" class="text-center">Register a new membership</a>
</div>
</form>
@stop
@extends('user::layouts.account')
@section('title')
Register | @parent
@stop
@section('content')
<div class="header">Register New Membership</div>
@include('flash::message')
{!! Form::open(array('route' => 'register.post')) !!}
<div class="body bg-gray">
<div class="form-group{{ $errors->has('email') ? ' has-error has-feedback' : '' }}">
{!! Form::label('email', 'Email:') !!}
{!! Form::text('email', Input::old('email'), ['class' => 'form-control', 'placeholder' => 'Email']) !!}
{!! $errors->first('email', '<span class="help-block">:message</span>') !!}
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error has-feedback' : '' }}">
{!! Form::label('password', 'Password:') !!}
{!! Form::password('password', ['class' => 'form-control', 'placeholder' => 'Password']) !!}
{!! $errors->first('password', '<span class="help-block">:message</span>') !!}
</div>
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error has-feedback' : '' }}">
{!! Form::label('password_confirmation', 'Password Confirmation:') !!}
{!! Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => 'Password Confirmation']) !!}
{!! $errors->first('password_confirmation', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="footer">
<button type="submit" class="btn btn-info btn-block">Sign me up</button>
<a href="{{ URL::route('login') }}" class="text-center">I already have a membership</a>
</div>
{!! Form::close() !!}
@stop
@extends('user::layouts.account')
@section('title')
Reset password | @parent
@stop
@section('content')
<div class="header">Reset Password</div>
@include('flash::message')
{!! Form::open(array('route' => 'reset.post')) !!}
<div class="body bg-gray">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<input type="email" name="email" class="form-control"
placeholder="Email" value="{{ Input::old('email')}}" required=""/>
{!! $errors->first('email', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="footer">
<button type="submit" class="btn bg-olive btn-block">Reset</button>
<p><a href="{{URL::route('login')}}">I remembered my password.</a></p>
</div>
{!! Form::close(); !!}
@stop
@extends('user::layouts.account')
@section('title')
Reset password | @parent
@stop
@section('content')
<div class="header">Reset Password</div>
@include('flash::message')
{!! Form::open() !!}
<div class="body bg-gray">
<div class="form-group{{ $errors->has('password') ? ' has-error has-feedback' : '' }}">
{!! Form::label('password', 'Password:') !!}
{!! Form::password('password', ['class' => 'form-control', 'placeholder' => 'Password']) !!}
{!! $errors->first('password', '<span class="help-block">:message</span>') !!}
</div>
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error has-feedback' : '' }}">
{!! Form::label('password_confirmation', 'Password Confirmation:') !!}
{!! Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => 'Password Confirmation']) !!}
{!! $errors->first('password_confirmation', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="footer">
<button type="submit" class="btn bg-olive btn-block">Reset</button>
</div>
{!! Form::close(); !!}
@stop
{
"name": "asgardcms/user-module",
"type": "asgard-module",
"description": "User module for AsgardCMS. Handles the authentication and authorisation as well as the user management.",
"keywords": [
"asgardcms",
"user",
"authentication",
"authorisation"
],
"license": "MIT",
"authors": [
{
"name": "Nicolas Widart",
"email": "info@asgardcms.com",
"role": "Developer"
}
],
"support": {
"email": "support@asgardcms.com",
"issues": "https://github.com/AsgardCms/User/issues",
"source": "https://github.com/AsgardCms/User"
},
"require": {
"php": ">=5.4",
"composer/installers": "~1.0"
},
"minimum-stability": "dev"
}
<?php
View::composer('core::partials.sidebar-nav', 'Modules\User\Composers\SidebarViewComposer');
View::composer([
'user::admin.partials.permissions',
'user::admin.partials.permissions-create',
], 'Modules\User\Composers\PermissionsViewComposer');
View::composer(['core::partials.sidebar-nav', 'core::partials.top-nav'], 'Modules\User\Composers\UsernameViewComposer');
<?php
Event::listen('Modules.User.Events.*', 'Modules\User\Listeners\SendResetCodeEmail');
Event::listen('Modules.User.Events.*', 'Modules\User\Listeners\SendRegistrationConfirmationEmail');
{
"name": "User",
"alias": "user",
"description": "",
"keywords": [],
"active": 1,
"providers": [
"Modules\\User\\Providers\\UserServiceProvider",
"Modules\\User\\Providers\\RouteServiceProvider"
],
"files": [
"start.php"
]
}
# User module
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/304d1d01-3347-4958-915f-b2daabfe5f5a/mini.png)](https://insight.sensiolabs.com/projects/304d1d01-3347-4958-915f-b2daabfe5f5a)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AsgardCms/User/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AsgardCms/User/?branch=master)
[![Code Climate](https://codeclimate.com/github/AsgardCms/User/badges/gpa.svg)](https://codeclimate.com/github/AsgardCms/User)
<?php
require __DIR__ . '/composers.php';
require __DIR__ . '/listeners.php';
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