mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
35 lines
985 B
PHP
35 lines
985 B
PHP
<?php
|
|
require_once __DIR__ . "/../../bootstrap.php";
|
|
require_once __DIR__ . '/../../src/AdminAuth.php';
|
|
AdminAuth::requireLogin();
|
|
|
|
if (empty($_SESSION['csrf_token'])) {
|
|
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
|
}
|
|
|
|
require_once APP_ROOT . '/src/Controllers/ThesisEditController.php';
|
|
|
|
$thesisId = isset($_GET['id']) ? intval($_GET['id']) : 0;
|
|
|
|
if ($thesisId <= 0) {
|
|
die("ID invalide");
|
|
}
|
|
|
|
$autofocusField = App::consumeAutofocus();
|
|
|
|
try {
|
|
$ctrl = ThesisEditController::create();
|
|
$view = $ctrl->load($thesisId);
|
|
extract($view);
|
|
} catch (Exception $e) {
|
|
error_log("Error loading edit page: " . $e->getMessage());
|
|
die("Erreur lors du chargement: " . $e->getMessage());
|
|
}
|
|
|
|
$isAdmin = true; $bodyClass = 'admin-body';
|
|
$extraCss = ['/assets/css/form.css'];
|
|
require_once APP_ROOT . '/templates/head.php';
|
|
include APP_ROOT . '/templates/header.php';
|
|
include APP_ROOT . '/templates/admin/edit.php';
|
|
require_once APP_ROOT . '/templates/admin/footer.php';
|