modifié : SRC/app/Http/Controllers/LoginController.php

This commit is contained in:
sidya82 2015-02-17 22:45:45 +01:00
parent 8db3ab513c
commit 860189859b
2 changed files with 16 additions and 3 deletions

View File

@ -42,7 +42,7 @@ class LoginController extends Controller {
{
if(Auth::attempt($credentials))
{
if (Auth::user()->admin == 1)
if (Auth::user()->droits != 0)
return redirect()->intended('admin');
else
return redirect()->intended('referent');

View File

@ -25,6 +25,19 @@ class UserTableSeeder extends Seeder {
{
// Uncomment the below to wipe the table clean before populating
//DB::table('users')->truncate();
$user = array(
'firstname' => 'superadmin',
'lastname' => 'superadmin',
'city' => 'Montauban',
'email' => 'superAdmin@superAdmin.com',
'password' => Hash::make('superadmin'),
'image' => 'pictures/user_picture/default.png',
'droits' => '2'
);
// Uncomment the below to run the seeder
DB::table('users')->insert($user);
$user = array(
'firstname' => 'admin',
@ -33,7 +46,7 @@ class UserTableSeeder extends Seeder {
'email' => 'admin@admin.com',
'password' => Hash::make('admin'),
'image' => 'pictures/user_picture/default.png',
'admin' => '1'
'droits' => '1'
);
// Uncomment the below to run the seeder
@ -46,7 +59,7 @@ class UserTableSeeder extends Seeder {
'email' => 'ref@ref.com',
'password' => Hash::make('ref'),
'image' => 'pictures/user_picture/default.png',
'admin' => '0'
'droits' => '0'
);
// Uncomment the below to run the seeder