restricted admin role in crewsportswear site
This commit is contained in:
@@ -19,6 +19,18 @@ class CustomAuthController extends Controller {
|
|||||||
$password = $post['password'];
|
$password = $post['password'];
|
||||||
|
|
||||||
if (Auth::attempt(['email' => $email, 'password' => $password])){
|
if (Auth::attempt(['email' => $email, 'password' => $password])){
|
||||||
|
|
||||||
|
if (Auth::user()->role == 'admin') {
|
||||||
|
$message = '
|
||||||
|
<div class="alert alert-danger alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
<h4><i class="icon fa fa-ban"></i> ERROR:</h4>
|
||||||
|
You are not allowed to enter to this site.
|
||||||
|
</div>';
|
||||||
|
return response()->json(array('success' => false, 'message'=>$message));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$message = "success";
|
$message = "success";
|
||||||
$navbar = view('layout.navbar', compact('view'))->render();
|
$navbar = view('layout.navbar', compact('view'))->render();
|
||||||
$save_design_button = ' <button type="button" class="btn btn-lg btn-primary pull-right" data-toggle="modal" data-target="#modalDesignName"><i class="fa fa-floppy-o" aria-hidden="true"></i> Save Design</button>';
|
$save_design_button = ' <button type="button" class="btn btn-lg btn-primary pull-right" data-toggle="modal" data-target="#modalDesignName"><i class="fa fa-floppy-o" aria-hidden="true"></i> Save Design</button>';
|
||||||
|
|||||||
Reference in New Issue
Block a user