From 263ca9c88c49e249ce93af71659fed1341db1625 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 18 Nov 2019 15:26:21 +0800 Subject: [PATCH] restricted admin role in crewsportswear site --- app/Http/Controllers/CustomAuthController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Http/Controllers/CustomAuthController.php b/app/Http/Controllers/CustomAuthController.php index 2fc2994..0dc825c 100644 --- a/app/Http/Controllers/CustomAuthController.php +++ b/app/Http/Controllers/CustomAuthController.php @@ -19,6 +19,18 @@ class CustomAuthController extends Controller { $password = $post['password']; if (Auth::attempt(['email' => $email, 'password' => $password])){ + + if (Auth::user()->role == 'admin') { + $message = ' +
+ +

ERROR:

+ You are not allowed to enter to this site. +
'; + return response()->json(array('success' => false, 'message'=>$message)); + } + + $message = "success"; $navbar = view('layout.navbar', compact('view'))->render(); $save_design_button = ' ';