Files
xamxam/formulaire/thanks.php
Théophile Gervreau-Mercier 99ccd60f90 Add SQLite database schema and documentation
Added complete database schema for Post-ERG thesis archive:
- schema.sql with full relational database structure
- README.md with schema documentation and usage examples
- SETUP.md with comprehensive setup and maintenance guide
- posterg_fiche-technique.md with technical specifications
- Database_TFE_test.csv and .ods with example data

Database features:
- Normalized relational schema (3NF)
- Support for multiple authors, supervisors, languages, formats, keywords
- Publication workflow (submission → defense → jury review → publication)
- Access control (Libre/Interne/Interdit)
- File attachments tracking
- Predefined reference tables for orientations, AP programs, finalities
- Views for simplified querying
- Automatic timestamps and cascade deletes
2026-01-27 15:37:55 +01:00

82 lines
2.6 KiB
PHP

<?php
// Configure error reporting
ini_set('display_errors', 0);
ini_set('log_errors', 1);
ini_set('error_log', 'error.log');
require 'vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
// Security: Validate file parameter to prevent path traversal
$yamlFile = '';
$data = null;
$error = null;
if (isset($_GET['file'])) {
$requestedFile = urldecode($_GET['file']);
// Security: Only allow files from the yaml directory
$yamlFolder = realpath(__DIR__ . '/data/yaml/');
$requestedPath = realpath($requestedFile);
// Verify the file exists and is within the allowed directory
if ($requestedPath &&
$yamlFolder &&
strpos($requestedPath, $yamlFolder) === 0 &&
file_exists($requestedPath) &&
pathinfo($requestedPath, PATHINFO_EXTENSION) === 'yaml') {
try {
$data = Yaml::parseFile($requestedPath);
$yamlFile = $requestedPath;
} catch (Exception $e) {
error_log("Error parsing YAML file: " . $e->getMessage());
$error = "Erreur lors de la lecture du fichier.";
}
} else {
error_log("Invalid file access attempt: " . $requestedFile);
$error = "Fichier non valide ou accès refusé.";
}
} else {
$error = "Aucun fichier spécifié.";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ThankYou</title>
<link rel="stylesheet" href="assets/normalize.css">
<link rel="stylesheet" href="assets/simple.css">
<link rel="stylesheet" href="assets/posterg.css">
<link rel="shortcut icon" href="assets/icon.svg" type="image/svg">
</head>
<body>
<header>
<h1>Merci 💜</h1>
</header>
<main>
<?php if ($error): ?>
<p style="color: red;">⚠️ <?php echo htmlspecialchars($error); ?></p>
<p>Pour revenir au <a href="index.php">formulaire</a>.</p>
<?php elseif ($data): ?>
<p>d'avoir rempli le formulaire. Le contenu soumis a été sauvegardé et est en attente de traitement.</p>
<h4>Voici les informations que vous avez encodées dans le formulaire, affiché tel que c'est stocké, en yaml:</h4>
<pre><code><?php echo htmlspecialchars(Yaml::dump($data)); ?></code></pre>
<p>Pour revenir au <a href="index.php">formulaire</a>.</p>
<?php else: ?>
<p>Aucune donnée à afficher.</p>
<p>Pour revenir au <a href="index.php">formulaire</a>.</p>
<?php endif; ?>
</main>
<footer>
<p>Formulaire fait avec ❤ en PHP et <a href="https://github.com/kevquirk/simple.css">SimpleCSS</a>.</p>
</footer>
</body>
</html>