commit 08-2025

This commit is contained in:
Kevin Adametz 2025-08-12 18:01:59 +02:00
parent 9ae662f63e
commit 480fdc65ed
404 changed files with 65310 additions and 2600431 deletions

View file

@ -16,11 +16,22 @@ class Admin
*/
public function handle($request, Closure $next)
{
if ( Auth::check() && Auth::user()->isAdmin() )
{
if (!Auth::check()) {
return redirect('/home');
}
$user = Auth::user();
// Explizit VIPs blockieren (admin = 1)
if ($user->admin == 1) {
abort(403, 'VIP-Benutzer haben keinen Zugang zum Admin-Bereich.');
}
// Nur echte Admins (admin >= 2) durchlassen
if ($user->admin >= 2) {
return $next($request);
}
return redirect('/home');
}
}