diff --git a/App/.htaccess b/App/.htaccess index 109ba40..b97951c 100644 --- a/App/.htaccess +++ b/App/.htaccess @@ -6,6 +6,11 @@ Require all denied +# Backend-Editor-UI (statisch) nicht direkt ausliefern — nur über die +# admin-geschützte Route /stadt-editor (pages/stadt-editor.php) erreichbar. + + Require all denied + RewriteEngine On # Kein RewriteBase — Apache nutzt den Request-Pfad automatisch. diff --git a/App/admin-licenses.html b/App/admin-licenses.html index a7c5e11..55eee0a 100644 --- a/App/admin-licenses.html +++ b/App/admin-licenses.html @@ -48,6 +48,17 @@
+
+
🛠️ Backend-Werkzeuge (nur Admin)
+
+ 🗺️ Tourismus-Karten-Editor (Region) + 🏠 Tourismustal-Sprite-Editor + 🏙️ Stadt-Raumplanung-Editor + 📷 Schulbuch-Bildupload +
+
Alle nur mit Admin-Login erreichbar. Schulbuch-Upload zusätzlich per PIN (0815). Heli-Audio-Werkzeuge liegen nur lokal (.LocalDeveloperTools) und sind nicht auf dem Server.
+
+
Gesamt
diff --git a/App/pages/foto-upload.php b/App/pages/foto-upload.php index 1eff309..a4cc548 100644 --- a/App/pages/foto-upload.php +++ b/App/pages/foto-upload.php @@ -13,6 +13,11 @@ require_once __DIR__ . '/../php/config/app.php'; $bp = BASE_PATH; +/* ---------- Zugang: eingeloggte:r Admin ODER PIN (Ausnahme, vorläufig) ---------- */ +require_once __DIR__ . '/../php/lib/Session.php'; +Session::start(); +$__isAdmin = !empty($_SESSION['admin_id']); + /* ---------- PIN-Schranke (im Browser gespeichert, 1 Jahr) ---------- */ $PIN = '0815'; $pinFehler = false; @@ -24,7 +29,7 @@ if (isset($_POST['pin'])) { } $pinFehler = true; } -if (($_COOKIE['ggs_foto_pin'] ?? '') !== $PIN) { +if (!$__isAdmin && ($_COOKIE['ggs_foto_pin'] ?? '') !== $PIN) { ?> diff --git a/App/pages/stadt-editor.php b/App/pages/stadt-editor.php index ea0ee68..24321b8 100644 --- a/App/pages/stadt-editor.php +++ b/App/pages/stadt-editor.php @@ -1 +1,3 @@ - + Require all denied + diff --git a/App/sims/tourismusregion/api/save_map.php b/App/sims/tourismusregion/api/save_map.php index 1f58fa0..2925619 100644 --- a/App/sims/tourismusregion/api/save_map.php +++ b/App/sims/tourismusregion/api/save_map.php @@ -14,8 +14,13 @@ require_once __DIR__ . '/../../../php/config/app.php'; require_once __DIR__ . '/../../../php/lib/Database.php'; require_once __DIR__ . '/../../../php/lib/Response.php'; require_once __DIR__ . '/../../../php/lib/Session.php'; -Session::start(); // Session laden, sonst ist $_SESSION leer → requireTeacher wirft immer 401 -Session::requireTeacher(); +Session::start(); // Session laden, sonst ist $_SESSION leer → Auth-Check wirft immer 401 +// Backend-Editor: Admin ODER eingeloggte Lehrperson darf speichern. +if (empty($_SESSION['admin_id']) && !Session::teacherId()) { + http_response_code(401); + echo json_encode(['ok' => false, 'error' => 'Nicht eingeloggt (Admin oder Lehrperson erforderlich).']); + exit; +} $raw = file_get_contents('php://input'); $data = json_decode($raw, true); diff --git a/App/sims/tourismusregion/editor.php b/App/sims/tourismusregion/editor.php new file mode 100644 index 0000000..dcb72eb --- /dev/null +++ b/App/sims/tourismusregion/editor.php @@ -0,0 +1,8 @@ + + Require all denied + diff --git a/App/sims/tourismustal/editor.php b/App/sims/tourismustal/editor.php new file mode 100644 index 0000000..6cbe9e4 --- /dev/null +++ b/App/sims/tourismustal/editor.php @@ -0,0 +1,8 @@ +