mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29:19 +02:00
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
This commit is contained in:
@@ -8,8 +8,39 @@ require 'vendor/autoload.php';
|
||||
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
$yamlFile = isset($_GET['file']) ? urldecode($_GET['file']) : '';
|
||||
$data = Yaml::parseFile($yamlFile);
|
||||
// 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>
|
||||
@@ -30,11 +61,19 @@ $data = Yaml::parseFile($yamlFile);
|
||||
<h1>Merci 💜</h1>
|
||||
</header>
|
||||
<main>
|
||||
<p>d'avoir rempli le formulaire. Le contenu soumis a été sauvegardé et est en attente de traitement.</p>
|
||||
<?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>
|
||||
|
||||
Reference in New Issue
Block a user