Backend-Editoren admin-geschuetzt (admin_gate) + Admin-Hub auf Admin-Seite; save_map admin-oder-lehrer; foto-upload admin-bypass (PIN bleibt)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin-Gate für Backend-Werkzeuge (Editoren, Uploads).
|
||||
* Nur mit gültiger Super-Admin-Session erreichbar — sonst Redirect zur Admin-Login-Seite.
|
||||
*
|
||||
* Standalone einbindbar: lädt eigene Abhängigkeiten (BASE_PATH + Session), weil diese
|
||||
* Werkzeuge z. T. als eigenständige .php ausgeliefert werden (nicht über den Front-Controller).
|
||||
*
|
||||
* Einbinden ganz am Anfang der zu schützenden Datei:
|
||||
* require __DIR__ . '/…/php/lib/admin_gate.php';
|
||||
*/
|
||||
if (!defined('BASE_PATH')) {
|
||||
require_once __DIR__ . '/../config/app.php';
|
||||
}
|
||||
if (!class_exists('Session')) {
|
||||
require_once __DIR__ . '/Session.php';
|
||||
}
|
||||
Session::start();
|
||||
|
||||
if (empty($_SESSION['admin_id'])) {
|
||||
$base = defined('BASE_PATH') ? BASE_PATH : '';
|
||||
header('Location: ' . $base . '/admin.html');
|
||||
exit;
|
||||
}
|
||||
Reference in New Issue
Block a user