| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- // Die Zeilen, die ein bestehendes Projekt braucht.
- // Zum Kopieren gedacht, nicht zum direkten Ausführen.
- // ---------------------------------------------------------------------------
- // 1. Adminseite für Update und Backup: <projekt>/admin/manage.php
- // ---------------------------------------------------------------------------
- require_once __DIR__ . "/../config.php";
- require_once __DIR__ . "/../includes/functions.php";
- // Anmeldung des Projekts zuerst prüfen – das Panel ist die mächtigste Seite
- // der Anwendung.
- if (empty($_SESSION["admin_logged_in"])) {
- header("Location: login.php");
- exit;
- }
- require __DIR__ . "/../manage-client/ui/panel.php";
- // ---------------------------------------------------------------------------
- // 2. Statusblock auf einer bestehenden Einstellungsseite
- // ---------------------------------------------------------------------------
- $manageStatusPanelUrl = "manage.php";
- include __DIR__ . "/../manage-client/ui/status-partial.php";
- // ---------------------------------------------------------------------------
- // 3. Automatisches Backup ohne Cron, z. B. auf dem Admin-Dashboard
- // ---------------------------------------------------------------------------
- require_once __DIR__ . "/../manage-client/lib/client.php";
- try {
- // Legt nur an, wenn MANAGE_BACKUP_AUTO_INTERVAL_SECONDS abgelaufen ist.
- manageBackupCreateAutomaticIfDue();
- } catch (Throwable $exception) {
- // Ein fehlgeschlagenes Backup darf das Dashboard nicht blockieren.
- error_log("Automatisches Backup fehlgeschlagen: " . $exception->getMessage());
- }
- // ---------------------------------------------------------------------------
- // 4. Update-Hinweis in der eigenen Navigation
- // ---------------------------------------------------------------------------
- require_once __DIR__ . "/../manage-client/lib/client.php";
- $manageStatus = manageClientStatus(); // wirft nie
- if ($manageStatus["update"] !== null && $manageStatus["update"]["available"]) {
- echo '<a href="manage.php">Update ' .
- htmlspecialchars($manageStatus["update"]["latest"], ENT_QUOTES, "UTF-8") .
- " verfügbar</a>";
- }
|