SNMP Teil hinzugefügt und router angepasst

This commit is contained in:
blaerf 2025-11-17 06:36:08 +01:00
parent e30660a446
commit 8688167da6

View File

@ -46,6 +46,7 @@ if (file_exists($configPath) === false) {
$config = require $configPath; $config = require $configPath;
use App\Controllers\AuthController; use App\Controllers\AuthController;
use App\Controllers\DashboardController;
// Hilfsfunktion für geschützte Routen // Hilfsfunktion für geschützte Routen
function requireLogin(array $config): void 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). // Neue Instanz der Klasse AuthController erstellen (wird bei Bedarf über den Autoloader geladen).
$authController = new AuthController($config); $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. // Anhand des Routing-Ziels (route) entscheiden, welcher Code ausgeführt wird.
switch ($route) { switch ($route) {
case 'login': case 'login':
@ -87,10 +91,7 @@ switch ($route) {
case 'dashboard': case 'dashboard':
requireLogin($config); requireLogin($config);
// Später: DashboardController aufrufen $dashboardController->show();
echo '<h1>Dashboard (Platzhalter)</h1>';
echo '<p>Hier kommt später dein SNMP/Server-Status hin.</p>';
echo '<p><a href="index.php?route=logout">Logout</a></p>';
break; break;
default: default: