Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function handle($request, Closure $next) |
||
18 | { |
||
19 | $adminPath = cbConfig('ADMIN_PATH', 'admin'); |
||
20 | |||
21 | if (auth('cbAdmin')->guest()) { |
||
22 | return redirect(url($adminPath.'/login'))->with('message', cbTrans('not_logged_in')); |
||
23 | } |
||
24 | |||
25 | if(!CRUDBooster::isSuperadmin()) { |
||
26 | return redirect($adminPath)->with(['message'=> cbTrans('denied_access'),'message_type'=>'warning']); |
||
27 | } |
||
28 | |||
29 | return $next($request); |
||
30 | } |
||
32 |