From 860189859bc4d5ef452b4563f8beb8c863ef2cfe Mon Sep 17 00:00:00 2001 From: sidya82 Date: Tue, 17 Feb 2015 22:45:45 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20SRC/app/Http/Controllers/LoginController.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SRC/app/Http/Controllers/LoginController.php | 2 +- SRC/database/seeds/DatabaseSeeder.php | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/SRC/app/Http/Controllers/LoginController.php b/SRC/app/Http/Controllers/LoginController.php index d83a98a..a67f490 100755 --- a/SRC/app/Http/Controllers/LoginController.php +++ b/SRC/app/Http/Controllers/LoginController.php @@ -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'); diff --git a/SRC/database/seeds/DatabaseSeeder.php b/SRC/database/seeds/DatabaseSeeder.php index 8ec2700..05ff635 100755 --- a/SRC/database/seeds/DatabaseSeeder.php +++ b/SRC/database/seeds/DatabaseSeeder.php @@ -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