Initial commit of the Asset Management System, including project structure, Docker configuration, database migrations, and core application files. Added user authentication, asset management features, and basic UI components.

This commit is contained in:
2025-08-22 21:41:02 +02:00
parent b43a98f0ec
commit 677f70a19c
52 changed files with 5186 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Middleware;
use App\Core\Request;
use App\Core\Response;
use App\Core\Session;
class AuthMiddleware
{
public function handle(Request $request, Response $response): void
{
$session = new Session();
// Check if user is logged in
if (!$session->isLoggedIn()) {
$session->flash('error', 'Bitte melden Sie sich an, um fortzufahren.');
$response->redirect('/login')->send();
}
// Check if session is expired
if ($session->isExpired()) {
$session->logout();
$session->flash('error', 'Ihre Sitzung ist abgelaufen. Bitte melden Sie sich erneut an.');
$response->redirect('/login')->send();
}
// Update last activity
$session->setLastActivity();
}
}