b9bcbf9198
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
25 lines
796 B
PHP
25 lines
796 B
PHP
<?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;
|
|
}
|