Commit 833cddb4 authored by Nicolas Widart's avatar Nicolas Widart

Merge commit 'aedb3fe5'

* commit 'aedb3fe5':
  Squashed 'Modules/User/' changes from f048f16..5b82381
parents b60516f5 aedb3fe5
...@@ -83,6 +83,8 @@ class SentinelGroupSeedTableSeeder extends Seeder ...@@ -83,6 +83,8 @@ class SentinelGroupSeedTableSeeder extends Seeder
'media.edit' => true, 'media.edit' => true,
'media.update' => true, 'media.update' => true,
'media.destroy' => true, 'media.destroy' => true,
/* Settings */
'settings.index' => true,
]; ];
$group->save(); $group->save();
......
...@@ -66,6 +66,8 @@ class SentryGroupSeedTableSeeder extends Seeder ...@@ -66,6 +66,8 @@ class SentryGroupSeedTableSeeder extends Seeder
'media.edit' => 1, 'media.edit' => 1,
'media.update' => 1, 'media.update' => 1,
'media.destroy' => 1, 'media.destroy' => 1,
/* Settings */
'settings.index' => 1,
], ],
)); ));
......
...@@ -56,7 +56,7 @@ class RolesController extends BaseUserModuleController ...@@ -56,7 +56,7 @@ class RolesController extends BaseUserModuleController
$this->role->create($data); $this->role->create($data);
Flash::success('Role created'); Flash::success(trans('user::messages.role created'));
return Redirect::route('dashboard.role.index'); return Redirect::route('dashboard.role.index');
} }
...@@ -69,6 +69,7 @@ class RolesController extends BaseUserModuleController ...@@ -69,6 +69,7 @@ class RolesController extends BaseUserModuleController
public function edit($id) public function edit($id)
{ {
if (!$role = $this->role->find($id)) { if (!$role = $this->role->find($id)) {
Flash::error(trans('user::messages.role not found'));
return Redirect::to('user::admin.roles.index'); return Redirect::to('user::admin.roles.index');
} }
...@@ -88,7 +89,7 @@ class RolesController extends BaseUserModuleController ...@@ -88,7 +89,7 @@ class RolesController extends BaseUserModuleController
$this->role->update($id, $data); $this->role->update($id, $data);
Flash::success('Role updated!'); Flash::success(trans('user::messages.role updated'));
return Redirect::route('dashboard.role.index'); return Redirect::route('dashboard.role.index');
} }
...@@ -102,7 +103,7 @@ class RolesController extends BaseUserModuleController ...@@ -102,7 +103,7 @@ class RolesController extends BaseUserModuleController
{ {
$this->role->delete($id); $this->role->delete($id);
Flash::success('Role deleted!'); Flash::success(trans('user::messages.role deleted'));
return Redirect::route('dashboard.role.index'); return Redirect::route('dashboard.role.index');
} }
......
...@@ -77,7 +77,7 @@ class UserController extends BaseUserModuleController ...@@ -77,7 +77,7 @@ class UserController extends BaseUserModuleController
$this->user->createWithRoles($data, $request->roles, true); $this->user->createWithRoles($data, $request->roles, true);
Flash::success('User created.'); Flash::success(trans('user::messages.user created'));
return Redirect::route('dashboard.user.index'); return Redirect::route('dashboard.user.index');
} }
...@@ -90,7 +90,7 @@ class UserController extends BaseUserModuleController ...@@ -90,7 +90,7 @@ class UserController extends BaseUserModuleController
public function edit($id) public function edit($id)
{ {
if (!$user = $this->user->find($id)) { if (!$user = $this->user->find($id)) {
Flash::error('User not found'); Flash::error(trans('user::messages.user not found'));
return Redirect::route('dashboard.user.index'); return Redirect::route('dashboard.user.index');
} }
$roles = $this->role->all(); $roles = $this->role->all();
...@@ -111,7 +111,7 @@ class UserController extends BaseUserModuleController ...@@ -111,7 +111,7 @@ class UserController extends BaseUserModuleController
$this->user->updateAndSyncRoles($id, $data, $request->roles); $this->user->updateAndSyncRoles($id, $data, $request->roles);
Flash::success('User updated.'); Flash::success(trans('user::messages.user updated'));
return Redirect::route('dashboard.user.index'); return Redirect::route('dashboard.user.index');
} }
...@@ -125,7 +125,7 @@ class UserController extends BaseUserModuleController ...@@ -125,7 +125,7 @@ class UserController extends BaseUserModuleController
{ {
$this->user->delete($id); $this->user->delete($id);
Flash::success('User deleted'); Flash::success(trans('user::messages.user deleted'));
return Redirect::route('dashboard.user.index'); return Redirect::route('dashboard.user.index');
} }
......
...@@ -41,7 +41,7 @@ class AuthController ...@@ -41,7 +41,7 @@ class AuthController
$error = $this->auth->login($credentials, $remember); $error = $this->auth->login($credentials, $remember);
if (!$error) { if (!$error) {
Flash::success('Successfully logged in.'); Flash::success(trans('user::messages.successfully logged in'));
return Redirect::intended('/'); return Redirect::intended('/');
} }
...@@ -58,7 +58,7 @@ class AuthController ...@@ -58,7 +58,7 @@ class AuthController
{ {
$this->execute('Modules\User\Commands\RegisterNewUserCommand', $request->all()); $this->execute('Modules\User\Commands\RegisterNewUserCommand', $request->all());
Flash::success('Account created. Please check your email to activate your account.'); Flash::success(trans('user::messages.account created check email for activation'));
return Redirect::route('register'); return Redirect::route('register');
} }
...@@ -73,10 +73,10 @@ class AuthController ...@@ -73,10 +73,10 @@ class AuthController
public function getActivate($userId, $code) public function getActivate($userId, $code)
{ {
if ($this->auth->activate($userId, $code)) { if ($this->auth->activate($userId, $code)) {
Flash::success('Account activated. You can now login.'); Flash::success(trans('user::messages.account activated you can now login'));
return Redirect::route('login'); return Redirect::route('login');
} }
Flash::error('There was an error with the activation.'); Flash::error(lang('user::messages.there was an error with the activation'));
return Redirect::route('register'); return Redirect::route('register');
} }
...@@ -90,13 +90,12 @@ class AuthController ...@@ -90,13 +90,12 @@ class AuthController
try { try {
$this->execute('Modules\User\Commands\BeginResetProcessCommand', $request->all()); $this->execute('Modules\User\Commands\BeginResetProcessCommand', $request->all());
} catch (UserNotFoundException $e) { } catch (UserNotFoundException $e) {
Flash::error('No user with that email address belongs in our system.'); Flash::error(trans('user::messages.no user found'));
return Redirect::back()->withInput(); return Redirect::back()->withInput();
} }
Flash::success('Check your email to reset your password.'); Flash::success(trans('user::messages.check email to reset password'));
return Redirect::route('reset'); return Redirect::route('reset');
} }
...@@ -113,14 +112,14 @@ class AuthController ...@@ -113,14 +112,14 @@ class AuthController
array_merge($request->all(), ['userId' => $userId, 'code' => $code]) array_merge($request->all(), ['userId' => $userId, 'code' => $code])
); );
} catch (UserNotFoundException $e) { } catch (UserNotFoundException $e) {
Flash::error('The user no longer exists.'); Flash::error(trans('user::messages.user no longer exists'));
return Redirect::back()->withInput(); return Redirect::back()->withInput();
} catch (InvalidOrExpiredResetCode $e) { } catch (InvalidOrExpiredResetCode $e) {
Flash::error('Invalid or expired reset code.'); Flash::error(trans('user::messages.invalid reset code'));
return Redirect::back()->withInput(); return Redirect::back()->withInput();
} }
Flash::success('Password has been reset. You can now login with your new password.'); Flash::success(trans('user::messages.password reset'));
return Redirect::route('login'); return Redirect::route('login');
} }
} }
<?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 [
/* 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',
];
...@@ -100,19 +100,24 @@ ...@@ -100,19 +100,24 @@
@stop @stop
@section('scripts') @section('scripts')
<?php $locale = App::getLocale(); ?>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
$('.data-table').dataTable({ $('.data-table').dataTable({
"bPaginate": true, "paginate": true,
"bLengthChange": true, "lengthChange": true,
"bFilter": true, "filter": true,
"bSort": true, "sort": true,
"bInfo": true, "info": true,
"bAutoWidth": true, "autoWidth": true,
"aoColumns": [ "order": [[ 0, "desc" ]],
"language": {
"url": '<?php echo Module::asset("core:js/vendor/datatables/{$locale}.json") ?>'
},
"columns": [
null, null,
null, null,
{ "bSortable": false } { "sortable": false }
] ]
}); });
}); });
......
...@@ -116,21 +116,26 @@ ...@@ -116,21 +116,26 @@
@stop @stop
@section('scripts') @section('scripts')
<?php $locale = App::getLocale(); ?>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
$('.data-table').dataTable({ $('.data-table').dataTable({
"bPaginate": true, "paginate": true,
"bLengthChange": true, "lengthChange": true,
"bFilter": true, "filter": true,
"bSort": true, "sort": true,
"bInfo": true, "info": true,
"bAutoWidth": true, "autoWidth": true,
"aoColumns": [ "order": [[ 0, "desc" ]],
"language": {
"url": '<?php echo Module::asset("core:js/vendor/datatables/{$locale}.json") ?>'
},
"columns": [
null, null,
null, null,
null, null,
null, null,
{ "bSortable": false } { "sortable": false }
] ]
}); });
}); });
......
...@@ -25,7 +25,7 @@ Login | @parent ...@@ -25,7 +25,7 @@ Login | @parent
</div> </div>
</div> </div>
<div class="footer"> <div class="footer">
<button type="submit" class="btn bg-olive btn-block">Sign me in</button> <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> <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> <a href="{{URL::route('register')}}" class="text-center">Register a new membership</a>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment