| Conditions | 6 |
| Paths | 6 |
| Total Lines | 20 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 16 | public function handle($request, Closure $next) |
||
| 17 | { |
||
| 18 | if (Request::isMethod('post')) { |
||
| 19 | return $next($request); |
||
| 20 | } |
||
| 21 | |||
| 22 | // if the current user has a forceupdate field set, we check that they can only access this route or a lower forceupdate step |
||
| 23 | |||
| 24 | if (backpack_user() != null) { |
||
| 25 | if (backpack_user()->isStudent()) { |
||
|
|
|||
| 26 | if (backpack_user()->student->force_update) { |
||
| 27 | // if the user wants to go further than authorized, redirect them to the current step |
||
| 28 | if ($request->path() != 'edit/'.backpack_user()->student->force_update) { |
||
| 29 | return redirect(url('edit/'.backpack_user()->student->force_update)); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | return $next($request); |
||
| 36 | } |
||
| 38 |