| Conditions | 7 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function handle($request, Closure $next) |
||
| 18 | { |
||
| 19 | // If the discuss is disabled and the user is not admin. |
||
| 20 | if ((!Auth::user() && config('settings.discuss.enabled') == false) || |
||
| 21 | (config('settings.discuss.enabled') == false && Auth::user()->level() < 4) |
||
| 22 | ) { |
||
| 23 | return redirect() |
||
| 24 | ->route('page.index') |
||
| 25 | ->with('danger', 'Le système de discussion est temporairement désactivé.'); |
||
| 26 | } |
||
| 27 | |||
| 28 | // If the discuss is disabled and the user is admin. |
||
| 29 | if (config('settings.discuss.enabled') == false && Auth::user()->level() >= 4) { |
||
| 30 | Session::flash('danger', 'Le système de discussion est actuellement désactivé.'); |
||
| 31 | } |
||
| 32 | |||
| 33 | return $next($request); |
||
| 34 | } |
||
| 36 |