mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
refactor: move Restrictions d'accès aux fichiers from contenus.php to acces.php, cleanup section
This commit is contained in:
@@ -15,8 +15,12 @@ $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https'
|
||||
$baseUrl = $protocol . '://' . ($_SERVER['HTTP_HOST'] ?? 'localhost');
|
||||
|
||||
// ── Demandes d'accès aux fichiers ─────────────────────────────────────────────
|
||||
require_once APP_ROOT . '/src/Database.php';
|
||||
require_once APP_ROOT . '/src/Controllers/FileAccessController.php';
|
||||
|
||||
$db = new Database();
|
||||
$siteSettings = $db->getAllSettings();
|
||||
|
||||
$controller = FileAccessController::create();
|
||||
$vars = $controller->handle();
|
||||
extract($vars);
|
||||
|
||||
@@ -162,8 +162,10 @@ $_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
||||
|
||||
// Redirect back to wherever the form came from, defaulting to parametres
|
||||
$redirect = '/admin/parametres.php';
|
||||
if (in_array($section, ['formulaire_restrictions', 'formulaire_acces', 'objet_types'], true)) {
|
||||
if (in_array($section, ['formulaire_acces', 'objet_types'], true)) {
|
||||
$redirect = '/admin/contenus.php';
|
||||
} elseif ($section === 'formulaire_restrictions') {
|
||||
$redirect = '/admin/acces.php';
|
||||
}
|
||||
header('Location: ' . $redirect);
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user