modifié : SRC/app/Http/Controllers/LoginController.php
This commit is contained in:
parent
8db3ab513c
commit
860189859b
@ -42,7 +42,7 @@ class LoginController extends Controller {
|
|||||||
{
|
{
|
||||||
if(Auth::attempt($credentials))
|
if(Auth::attempt($credentials))
|
||||||
{
|
{
|
||||||
if (Auth::user()->admin == 1)
|
if (Auth::user()->droits != 0)
|
||||||
return redirect()->intended('admin');
|
return redirect()->intended('admin');
|
||||||
else
|
else
|
||||||
return redirect()->intended('referent');
|
return redirect()->intended('referent');
|
||||||
|
@ -25,6 +25,19 @@ class UserTableSeeder extends Seeder {
|
|||||||
{
|
{
|
||||||
// Uncomment the below to wipe the table clean before populating
|
// Uncomment the below to wipe the table clean before populating
|
||||||
//DB::table('users')->truncate();
|
//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(
|
$user = array(
|
||||||
'firstname' => 'admin',
|
'firstname' => 'admin',
|
||||||
@ -33,7 +46,7 @@ class UserTableSeeder extends Seeder {
|
|||||||
'email' => 'admin@admin.com',
|
'email' => 'admin@admin.com',
|
||||||
'password' => Hash::make('admin'),
|
'password' => Hash::make('admin'),
|
||||||
'image' => 'pictures/user_picture/default.png',
|
'image' => 'pictures/user_picture/default.png',
|
||||||
'admin' => '1'
|
'droits' => '1'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Uncomment the below to run the seeder
|
// Uncomment the below to run the seeder
|
||||||
@ -46,7 +59,7 @@ class UserTableSeeder extends Seeder {
|
|||||||
'email' => 'ref@ref.com',
|
'email' => 'ref@ref.com',
|
||||||
'password' => Hash::make('ref'),
|
'password' => Hash::make('ref'),
|
||||||
'image' => 'pictures/user_picture/default.png',
|
'image' => 'pictures/user_picture/default.png',
|
||||||
'admin' => '0'
|
'droits' => '0'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Uncomment the below to run the seeder
|
// Uncomment the below to run the seeder
|
||||||
|
Reference in New Issue
Block a user