diff --git a/public/index.php b/public/index.php index c8d556a..f9b853e 100644 --- a/public/index.php +++ b/public/index.php @@ -46,6 +46,7 @@ if (file_exists($configPath) === false) { $config = require $configPath; use App\Controllers\AuthController; +use App\Controllers\DashboardController; // Hilfsfunktion für geschützte Routen function requireLogin(array $config): void @@ -67,6 +68,9 @@ $route = $_GET['route'] ?? 'login'; // Neue Instanz der Klasse AuthController erstellen (wird bei Bedarf über den Autoloader geladen). $authController = new AuthController($config); +// Neue Instanz der Klasse DashboardController erstellen (wird bei Bedarf über den Autoloader geladen). +$dashboardController = new DashboardController($config); + // Anhand des Routing-Ziels (route) entscheiden, welcher Code ausgeführt wird. switch ($route) { case 'login': @@ -87,10 +91,7 @@ switch ($route) { case 'dashboard': requireLogin($config); - // Später: DashboardController aufrufen - echo '
Hier kommt später dein SNMP/Server-Status hin.
'; - echo ''; + $dashboardController->show(); break; default: