| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php namespace Modules\Core\Http\Middleware; |
||
| 48 | public function handle($request, \Closure $next) |
||
| 49 | { |
||
| 50 | // Check if the user is logged in |
||
| 51 | if (!$this->auth->check()) { |
||
| 52 | // Store the current uri in the session |
||
| 53 | $this->session->put('url.intended', $this->request->url()); |
||
| 54 | |||
| 55 | // Redirect to the login page |
||
| 56 | return $this->redirect->route('login'); |
||
| 57 | } |
||
| 58 | |||
| 59 | // Check if the user has access to the dashboard page |
||
| 60 | if (! $this->auth->hasAccess('dashboard.index')) { |
||
| 61 | // Show the insufficient permissions page |
||
| 62 | return $this->application->abort(403); |
||
| 63 | } |
||
| 64 | |||
| 65 | return $next($request); |
||
| 66 | } |
||
| 67 | } |
||
| 68 |