rewrite v1.0

This commit is contained in:
Pontoporeia committed 2023-05-02 20:17:58 +02:00
1 parent 763ad7d722
commit 4a1e4b696e
9 files changed
+299 -23

No files matched your search

+2 -1
View File
@@ -1,4 +1,5 @@
/vendor/
/composer.lock
### Data et Mémoire###
data
data/yaml/
data/content/
File renamed without changes.
+65
View File
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="lucide lucide-archive-restore"
version="1.1"
id="svg12"
sodipodi:docname="icon.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs16" />
<sodipodi:namedview
id="namedview14"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="24.719275"
inkscape:cx="5.2185997"
inkscape:cy="13.713995"
inkscape:window-width="1920"
inkscape:window-height="1011"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="svg12" />
<rect
width="20"
height="5"
x="2"
y="4"
rx="2"
id="rect2"
style="stroke:#c104fc;stroke-opacity:1" />
<path
d="M12 13v7"
id="path4"
style="stroke:#c104fc;stroke-opacity:1" />
<path
d="m9 16 3-3 3 3"
id="path6"
style="stroke:#c104fc;stroke-opacity:1" />
<path
d="M4 9v9a2 2 0 0 0 2 2h2"
id="path8"
style="stroke:#c104fc;stroke-opacity:1" />
<path
d="M20 9v9a2 2 0 0 1-2 2h-2"
id="path10"
style="stroke:#c104fc;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg"><symbol id="trumbowyg-blockquote" viewBox="0 0 72 72"><path d="M21.3 31.9h-.6c.8-1.2 1.9-2.2 3.4-3.2 2.1-1.4 5-2.7 9.2-3.3l-1.4-8.9c-4.7.7-8.5 2.1-11.7 4-2.4 1.4-4.3 3.1-5.8 4.9-2.3 2.7-3.7 5.7-4.5 8.5-.8 2.8-1 5.4-1 7.5 0 2.3.3 4 .4 4.8 0 .1.1.3.1.4 1.2 5.4 6.1 9.5 11.9 9.5 6.7 0 12.2-5.4 12.2-12.2s-5.5-12-12.2-12zM49.5 31.9h-.6c.8-1.2 1.9-2.2 3.4-3.2 2.1-1.4 5-2.7 9.2-3.3l-1.4-8.9c-4.7.7-8.5 2.1-11.7 4-2.4 1.4-4.3 3.1-5.8 4.9-2.3 2.7-3.7 5.7-4.5 8.5-.8 2.8-1 5.4-1 7.5 0 2.3.3 4 .4 4.8 0 .1.1.3.1.4 1.2 5.4 6.1 9.5 11.9 9.5 6.7 0 12.2-5.4 12.2-12.2s-5.5-12-12.2-12z"/></symbol><symbol id="trumbowyg-bold" viewBox="0 0 72 72"><path d="M51.1 37.8c-1.1-1.4-2.5-2.5-4.2-3.3 1.2-.8 2.1-1.8 2.8-3 1-1.6 1.5-3.5 1.5-5.3 0-2-.6-4-1.7-5.8-1.1-1.8-2.8-3.2-4.8-4.1-2-.9-4.6-1.3-7.8-1.3h-16v42h16.3c2.6 0 4.8-.2 6.7-.7 1.9-.5 3.4-1.2 4.7-2.1 1.3-1 2.4-2.4 3.2-4.1.9-1.7 1.3-3.6 1.3-5.7.2-2.5-.5-4.7-2-6.6zM40.8 50.2c-.6.1-1.8.2-3.4.2h-9V38.5h8.3c2.5 0 4.4.2 5.6.6 1.2.4 2 1 2.7 2 .6.9 1 2 1 3.3 0 1.1-.2 2.1-.7 2.9-.5.9-1 1.5-1.7 1.9-.8.4-1.7.8-2.8 1zm2.6-20.4c-.5.7-1.3 1.3-2.5 1.6-.8.3-2.5.4-4.8.4h-7.7V21.6h7.1c1.4 0 2.6 0 3.6.1s1.7.2 2.2.4c1 .3 1.7.8 2.2 1.7.5.9.8 1.8.8 3-.1 1.3-.4 2.2-.9 3z"/></symbol><symbol id="trumbowyg-close" viewBox="0 0 72 72"><path d="M57 20.5l-5.4-5.4-15.5 15.5-15.6-15.5-5.4 5.4L30.7 36 15.1 51.5l5.4 5.4 15.6-15.5 15.5 15.5 5.4-5.4L41.5 36z"/></symbol><symbol id="trumbowyg-create-link" viewBox="0 0 72 72"><path d="M31.1 48.9l-6.7 6.7c-.8.8-1.6.9-2.1.9s-1.4-.1-2.1-.9L15 50.4c-1.1-1.1-1.1-3.1 0-4.2l6.1-6.1.2-.2 6.5-6.5c-1.2-.6-2.5-.9-3.8-.9-2.3 0-4.6.9-6.3 2.6L11 41.8c-3.5 3.5-3.5 9.2 0 12.7l5.2 5.2c1.7 1.7 4 2.6 6.3 2.6s4.6-.9 6.3-2.6l6.7-6.7c2.5-2.6 3.1-6.7 1.5-10l-5.9 5.9zM38.7 22.5l6.7-6.7c.8-.8 1.6-.9 2.1-.9s1.4.1 2.1.9l5.2 5.2c1.1 1.1 1.1 3.1 0 4.2l-6.1 6.1-.2.2L42 38c1.2.6 2.5.9 3.8.9 2.3 0 4.6-.9 6.3-2.6l6.7-6.7c3.5-3.5 3.5-9.2 0-12.7l-5.2-5.2c-1.7-1.7-4-2.6-6.3-2.6s-4.6.9-6.3 2.6l-6.7 6.7c-2.7 2.7-3.3 6.9-1.7 10.2l6.1-6.1c0 .1 0 .1 0 0z"/><path d="M44.2 30.5c.2-.2.4-.6.4-.9 0-.3-.1-.6-.4-.9l-2.3-2.3c-.3-.2-.6-.4-.9-.4-.3 0-.6.1-.9.4L25.9 40.6c-.2.2-.4.6-.4.9 0 .3.1.6.4.9l2.3 2.3c.2.2.6.4.9.4.3 0 .6-.1.9-.4l14.2-14.2zM49.9 55.4h-8.5v-5h8.5v-8.9h5.2v8.9h8.5v5h-8.5v8.9h-5.2v-8.9z"/></symbol><symbol id="trumbowyg-del" viewBox="0 0 72 72"><path d="M45.8 45c0 1-.3 1.9-.9 2.8-.6.9-1.6 1.6-3 2.1s-3.1.8-5 .8c-2.1 0-4-.4-5.7-1.1-1.7-.7-2.9-1.7-3.6-2.7-.8-1.1-1.3-2.6-1.5-4.5l-.1-.8-6.7.6v.9c.1 2.8.9 5.4 2.3 7.6 1.5 2.3 3.5 4 6.1 5.1 2.6 1.1 5.7 1.6 9.4 1.6 2.9 0 5.6-.5 8-1.6 2.4-1.1 4.3-2.7 5.6-4.7 1.3-2 2-4.2 2-6.5 0-1.6-.3-3.1-.9-4.5l-.2-.6H44c0 .1 1.8 2.3 1.8 5.5zM29 28.9c-.8-.8-1.2-1.7-1.2-2.9 0-.7.1-1.3.4-1.9.3-.6.7-1.1 1.4-1.6.6-.5 1.4-.9 2.5-1.1 1.1-.3 2.4-.4 3.9-.4 2.9 0 5 .6 6.3 1.7 1.3 1.1 2.1 2.7 2.4 5.1l.1.9 6.8-.5v-.9c-.1-2.5-.8-4.7-2.1-6.7s-3.2-3.5-5.6-4.5c-2.4-1-5.1-1.5-8.1-1.5-2.8 0-5.3.5-7.6 1.4-2.3 1-4.2 2.4-5.4 4.3-1.2 1.9-1.9 3.9-1.9 6.1 0 1.7.4 3.4 1.2 4.9l.3.5h11.8c-2.3-.9-3.9-1.7-5.2-2.9zm13.3-6.2zM22.7 20.3zM13 34.1h46.1v3.4H13z"/></symbol><symbol id="trumbowyg-em" viewBox="0 0 72 72"><path d="M26 57l10.1-42h7.2L33.2 57H26z"/></symbol><symbol id="trumbowyg-fullscreen" viewBox="0 0 72 72"><path d="M25.2 7.1H7.1v17.7l6.7-6.5 10.5 10.5 4.5-4.5-10.4-10.5zm22 0l6.5 6.7-10.5 10.5 4.5 4.5 10.5-10.4 6.7 6.8V7.1zm.5 36.1l-4.5 4.5 10.4 10.5-6.8 6.7h18.1V47.2l-6.7 6.5zm-23.4 0L13.8 53.6l-6.7-6.8v18.1h17.7l-6.5-6.7 10.5-10.5z"/><path fill="currentColor" d="M10.7 28.8h18.1V11.2l-6.6 6.4L11.6 7.1l-4.5 4.5 10.5 10.5zm50.1 0l-6.4-6.6 10.5-10.6-4.5-4.5-10.5 10.5-6.7-6.9v18.1zm-.4 36.1l4.5-4.5-10.5-10.5 6.9-6.7H43.2v17.6l6.6-6.4zm-48.8 0l10.5-10.5 6.7 6.9V43.2H11.1l6.5 6.6L7.1 60.4z"/></symbol><symbol id="trumbowyg-h1" viewBox="0 0 72 72"><path d="M6.4 14.9h7.4v16.7h19.1V14.9h7.4V57h-7.4V38H13.8v19H6.4V14.9zM47.8 22.5c1.4 0 2.8-.1 4.1-.4 1.3-.2 2.5-.6 3.6-1.2 1.1-.5 2-1.3 2.8-2.1.8-.9 1.3-1.9 1.5-3.2h5.5v41.2h-7.4v-29H47.8v-5.3z"/></symbol><symbol id="trumbowyg-h2" viewBox="0 0 72 72"><path d="M1.5 14.9h7.4v16.7H28V14.9h7.4V57H28V38H8.8v19H1.5V14.9zM70.2 56.9H42c0-3.4.9-6.4 2.5-9s3.8-4.8 6.6-6.7c1.3-1 2.7-1.9 4.2-2.9 1.5-.9 2.8-1.9 4-3 1.2-1.1 2.2-2.2 3-3.4.8-1.2 1.2-2.7 1.2-4.3 0-.7-.1-1.5-.3-2.4s-.5-1.6-1-2.4c-.5-.7-1.2-1.3-2.1-1.8-.9-.5-2.1-.7-3.5-.7-1.3 0-2.4.3-3.3.8s-1.6 1.3-2.1 2.2-.9 2-1.2 3.3c-.3 1.3-.4 2.6-.4 4.1h-6.7c0-2.3.3-4.4.9-6.3.6-1.9 1.5-3.6 2.7-5 1.2-1.4 2.7-2.5 4.4-3.3 1.7-.8 3.8-1.2 6.1-1.2 2.5 0 4.6.4 6.3 1.2 1.7.8 3.1 1.9 4.1 3.1 1 1.3 1.8 2.6 2.2 4.1.4 1.5.6 2.9.6 4.2 0 1.6-.3 3.1-.8 4.5-.5 1.3-1.2 2.6-2.1 3.7-.9 1.1-1.8 2.2-2.9 3.1-1.1.9-2.2 1.8-3.4 2.7-1.2.8-2.4 1.6-3.5 2.4-1.2.7-2.3 1.5-3.3 2.2-1 .7-1.9 1.5-2.6 2.3-.7.8-1.3 1.7-1.5 2.6h20.1v5.9z"/></symbol><symbol id="trumbowyg-h3" viewBox="0 0 72 72"><path d="M1.4 14.5h7.4v16.7h19.1V14.5h7.4v42.1h-7.4v-19H8.8v19H1.4V14.5zM53.1 32.4c1.1 0 2.2 0 3.3-.2 1.1-.2 2.1-.5 2.9-1 .9-.5 1.6-1.2 2.1-2 .5-.9.8-1.9.8-3.2 0-1.8-.6-3.2-1.8-4.2-1.2-1.1-2.7-1.6-4.6-1.6-1.2 0-2.2.2-3.1.7-.9.5-1.6 1.1-Line truncated

Before

Width:  |  Height:  |  Size: 31 KiB

+28 -10
View File
@@ -1,8 +1,26 @@
@font-face {
font-family: police1;
src: url("./fonts/Combinedd.otf");
src: url("./Combinedd.otf");
}
/* Dark theme */
/* UTILE POUR FORCER UN MODE LIGHT */
@media (prefers-color-scheme: dark) {
:root,
::backdrop {
--bg: #fff;
--accent-bg: #f5f7ff;
--text: #212121;
--text-light: #585858;
--border: #898EA4;
--accent: #0d47a1;
--code: #d81b60;
--preformatted: #444;
--marked: #ffdd33;
--disabled: #efefef;
}
}
body{
background-color: white;
}
@@ -10,15 +28,18 @@
/* ENTÊTE */
header {
font-family: 'police1';
background: linear-gradient(315deg, rgba(77, 168, 112, 1) 0%, rgba(193, 4, 252, 1) 66%);
background: linear-gradient(280deg, rgba(77, 168, 112, 1) 0%, rgba(193, 4, 252, 1) 85%);
text-decoration: none;
outline: none;
font-size: 2rem;
}
body > header h1 {
color: white;
margin: 3rem auto auto auto;
}
/* FORMULAIRE */
form label {
@@ -44,8 +65,8 @@
}
input {
font-family: police1;
font-weight: bold;
/* font-family: police1; */
/* font-weight: bold; */
background-color: none;
color: rgb(193, 4, 252);
border: 1px solid rgb(193, 4, 252);
@@ -72,10 +93,7 @@ input {
margin-top: 2rem;
}
body > header h1 {
color: white;
margin: 3rem auto auto auto;
}
+172
View File
@@ -2,3 +2,175 @@
Stack trace:
#0 {main}
thrown in /home/lockpick/Projects/posterg-formulaire/formulaire.php on line 42
[02-May-2023 17:27:08 UTC] FILES array: Array
(
[files] => Array
(
[name] => undefinedMega_2023-04-24.pdf
[full_path] => undefinedMega_2023-04-24.pdf
[type] => application/pdf
[tmp_name] => /tmp/phptz5xyY
[error] => 0
[size] => 64998
)
)
[02-May-2023 17:29:09 UTC] FILES array: Array
(
[files] => Array
(
[name] => undefinedMega_2023-04-24.pdf
[full_path] => undefinedMega_2023-04-24.pdf
[type] => application/pdf
[tmp_name] => /tmp/phpbgEPg4
[error] => 0
[size] => 64998
)
)
[02-May-2023 17:29:24 UTC] FILES array: Array
(
[files] => Array
(
[name] => Array
(
[0] => UdeM_Guide-ecriture-inclusive.pdf
[1] => undefinedMega_2023-04-24.pdf
)
[full_path] => Array
(
[0] => UdeM_Guide-ecriture-inclusive.pdf
[1] => undefinedMega_2023-04-24.pdf
)
[type] => Array
(
[0] => application/pdf
[1] => application/pdf
)
[tmp_name] => Array
(
[0] => /tmp/php5XBNaE
[1] => /tmp/phpGrs9Dq
)
[error] => Array
(
[0] => 0
[1] => 0
)
[size] => Array
(
[0] => 579957
[1] => 64998
)
)
)
[02-May-2023 17:29:24 UTC] Processing file: UdeM_Guide-ecriture-inclusive.pdf
[02-May-2023 17:29:24 UTC] File successfully moved: data/content///UdeM_Guide-ecriture-inclusive.pdf
[02-May-2023 17:29:24 UTC] Processing file: undefinedMega_2023-04-24.pdf
[02-May-2023 17:29:24 UTC] File successfully moved: data/content///undefinedMega_2023-04-24.pdf
[02-May-2023 17:31:08 UTC] FILES array: Array
(
[files] => Array
(
[name] => Array
(
[0] => UdeM_Guide-ecriture-inclusive.pdf
[1] => undefinedMega_2023-04-24.pdf
)
[full_path] => Array
(
[0] => UdeM_Guide-ecriture-inclusive.pdf
[1] => undefinedMega_2023-04-24.pdf
)
[type] => Array
(
[0] => application/pdf
[1] => application/pdf
)
[tmp_name] => Array
(
[0] => /tmp/phpQbhzwi
[1] => /tmp/phpm8u5q7
)
[error] => Array
(
[0] => 0
[1] => 0
)
[size] => Array
(
[0] => 579957
[1] => 64998
)
)
)
[02-May-2023 17:31:08 UTC] Processing file: UdeM_Guide-ecriture-inclusive.pdf
[02-May-2023 17:31:08 UTC] File successfully moved: data/content/2024/Théophile Gervreau-Mercier/UdeM_Guide-ecriture-inclusive.pdf
[02-May-2023 17:31:08 UTC] Processing file: undefinedMega_2023-04-24.pdf
[02-May-2023 17:31:08 UTC] File successfully moved: data/content/2024/Théophile Gervreau-Mercier/undefinedMega_2023-04-24.pdf
[02-May-2023 17:31:34 UTC] FILES array: Array
(
[files] => Array
(
[name] => Array
(
[0] => UdeM_Guide-ecriture-inclusive.pdf
[1] => undefinedMega_2023-04-24.pdf
)
[full_path] => Array
(
[0] => UdeM_Guide-ecriture-inclusive.pdf
[1] => undefinedMega_2023-04-24.pdf
)
[type] => Array
(
[0] => application/pdf
[1] => application/pdf
)
[tmp_name] => Array
(
[0] => /tmp/phpC8OF8o
[1] => /tmp/phpGoliAt
)
[error] => Array
(
[0] => 0
[1] => 0
)
[size] => Array
(
[0] => 579957
[1] => 64998
)
)
)
[02-May-2023 17:31:34 UTC] Processing file: UdeM_Guide-ecriture-inclusive.pdf
[02-May-2023 17:31:34 UTC] File successfully moved: data/content/2025/Théophile Gervreau-Mercier/UdeM_Guide-ecriture-inclusive.pdf
[02-May-2023 17:31:34 UTC] Processing file: undefinedMega_2023-04-24.pdf
[02-May-2023 17:31:34 UTC] File successfully moved: data/content/2025/Théophile Gervreau-Mercier/undefinedMega_2023-04-24.pdf
+21 -4
View File
@@ -5,6 +5,9 @@ ini_set('display_errors', 0);
ini_set('log_errors', 1);
ini_set('error_log', 'error.log');
// Log the content of the $_FILES array
error_log("FILES array: " . print_r($_FILES, true));
require_once 'vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
use Behat\Transliterator\Transliterator;
@@ -51,30 +54,43 @@ $maxFileSize = 5 * 1024 * 1024; // 5 MB
// Process uploaded files
if (is_array($files["name"])) {
for ($i = 0; $i < count($files["name"]); $i++) {
// Log the file being processed
error_log("Processing file: " . $files["name"][$i]);
// Check for file upload errors
if ($files["error"][$i] !== UPLOAD_ERR_OK) {
error_log("File upload error: " . $files["name"][$i]);
continue;
}
// Check MIME type and file extension
$finfo = new finfo(FILEINFO_MIME_TYPE);
$mimeType = $finfo->file($files["tmp_name"][$i]);
$fileExtension = pathinfo($files["name"][$i], PATHINFO_EXTENSION);
if (!in_array($mimeType, $allowedMimeTypes) || !in_array($fileExtension, $allowedExtensions)) {
echo "Invalid file type or extension: " . $files["name"][$i] . "<br>";
error_log("Invalid file type or extension: " . $files["name"][$i]);
continue;
}
// Check file size
if ($files["size"][$i] > $maxFileSize) {
echo "File is too large: " . $files["name"][$i] . "<br>";
error_log("File is too large: " . $files["name"][$i]);
continue;
}
// Move and set permissions for the uploaded file
$targetFile = $targetDir . basename($files["name"][$i]);
move_uploaded_file($files["tmp_name"][$i], $targetFile);
if (move_uploaded_file($files["tmp_name"][$i], $targetFile)) {
// Log successful file move
error_log("File successfully moved: " . $targetFile);
chmod($targetFile, 0644);
$uploadedFiles[] = $targetFile;
} else {
error_log("Failed to move uploaded file: " . $files["name"][$i]);
}
}
}
// Prepare form data for YAML
$formData = [
'auteurice' => $auteurice,
@@ -100,3 +116,4 @@ file_put_contents($yamlFilePath, $yamlData);
// Redirect to the thank you page
header('Location: thanks.php?file=' . urlencode($yamlFilePath));
?>
+9 -7
View File
@@ -9,6 +9,7 @@
<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>
@@ -19,16 +20,16 @@
<main>
<form action="formulaire.php" method="post" enctype="multipart/form-data">
<label>Nom/Prénom/Pseudo</label>
<input type="text" name="auteurice" placeholder="...">
<input type="text" name="auteurice" placeholder="..." required>
<label>Année diplômante (2020, 2021, ...)</label>
<input type="text" name="année" placeholder="...">
<label>Année diplômante (2023, 2024, ...)</label>
<input type="text" name="année" placeholder="..." required>
<label>Contact : mail, insta, ...</label>
<input type="email" name="mail" placeholder="Votre contact">
<label>Titre du mémoire</label>
<input type="titre" name="titre" placeholder="...">
<input type="titre" name="titre" placeholder="..." required>
<label>Tag/mots-clefs sur le mémoire</label>
<input type="text" name="tag" placeholder="typographie, photographie, outils libre, post-colonial,..">
@@ -44,7 +45,7 @@
<label>Orientation principale</label>
<select name="orientation">
<select name="orientation" required>
<option value="">-- Ton orientation --</option>
<option value="typographie">Typographie</option>
<option value="graphisme">Graphisme</option>
@@ -64,7 +65,7 @@
</select>
<label>Atelier Pratique</label>
<select name="ap">
<select name="ap" required>
<option value="">-- Ton AP --</option>
<option value="DPM">Design et politique du multiple</option>
<option value="APS">Art et pratique situé</option>
@@ -74,7 +75,8 @@
<label>Importer les divers fichers de son mémoire</label>
<i>Si tu veux importer un dossier, créer une archive zip.</i>
<input type="file" name="files" multiple><br>
<!-- THE FILES[] IS NECESSARY IF THERE ARE MULTIPLE FILES UPLOADED -->
<input type="file" name="files[]" multiple><br>
<input type="submit" name="go" value="envoyer">
</form>
+2
View File
@@ -22,6 +22,8 @@ $data = Yaml::parseFile($yamlFile);
<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>