SNMP Teil hinzugefügt und router angepasst
This commit is contained in:
parent
e30660a446
commit
8688167da6
@ -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 '<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>';
|
||||
$dashboardController->show();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user