mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
tfe.php: afficher CC2r + licence, formater contact court, supprimer download PDF
This commit is contained in:
5
TODO.md
5
TODO.md
@@ -1,5 +1,7 @@
|
|||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
- [x] Fix htmx checkbox "Activer la restriction d'accès": add missing csrf_token in #fieldset-restrictions (fixes token invalide + full parametres.php injection)
|
||||||
|
|
||||||
- [x] Convert all file inputs to FilePond (CSV import, file-field.php; fix dialog init + missing CSS/JS on index page)
|
- [x] Convert all file inputs to FilePond (CSV import, file-field.php; fix dialog init + missing CSS/JS on index page)
|
||||||
- [x] Fix `account.php`: replace `!==` CSRF token check with `hash_equals` (constant-time comparison)
|
- [x] Fix `account.php`: replace `!==` CSRF token check with `hash_equals` (constant-time comparison)
|
||||||
- [x] Fix `ShareLink::setPassword()`: also encrypt and store plain-text password, matching `create()` behavior
|
- [x] Fix `ShareLink::setPassword()`: also encrypt and store plain-text password, matching `create()` behavior
|
||||||
@@ -16,3 +18,6 @@
|
|||||||
- [x] Page TFE: corriger texte inclusif ("utilisateur·ices autorisé·es")
|
- [x] Page TFE: corriger texte inclusif ("utilisateur·ices autorisé·es")
|
||||||
- [x] Page TFE: empêcher les mots-clés de se couper au milieu du mot lors du wrapping
|
- [x] Page TFE: empêcher les mots-clés de se couper au milieu du mot lors du wrapping
|
||||||
- [x] Page TFE: rendre le texte des TFE internes/interdits éditable dans les paramètres
|
- [x] Page TFE: rendre le texte des TFE internes/interdits éditable dans les paramètres
|
||||||
|
- [x] Page TFE: afficher CC2r en plus de la licence choisie (ex: "CC2r, CC BY")
|
||||||
|
- [x] Page TFE: formater le contact au plus court (stripper https://www., afficher @identifiant pour Instagram/Mastodon)
|
||||||
|
- [x] Page TFE: supprimer le lien de téléchargement du PDF sous l'iframe
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
{"timestamp":"2026-06-08T08:33:36+00:00","ip":"127.0.0.1","user_agent":"Mozilla/5.0 (X11; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","resource":"thesis","action":"publish","status":"success","context":{"count":143,"ids":[143,142,141,140,139,138,137,136,135,134,133,132,131,130,129,128,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1]}}
|
{"timestamp":"2026-06-08T08:33:36+00:00","ip":"127.0.0.1","user_agent":"Mozilla/5.0 (X11; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","resource":"thesis","action":"publish","status":"success","context":{"count":143,"ids":[143,142,141,140,139,138,137,136,135,134,133,132,131,130,129,128,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1]}}
|
||||||
|
{"timestamp":"2026-06-08T09:24:44+00:00","ip":"127.0.0.1","user_agent":"Mozilla/5.0 (X11; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","resource":"settings","action":"formulaire_update","status":"success","context":{"values":{"restricted_files_enabled":"0"}}}
|
||||||
|
|||||||
@@ -164,10 +164,13 @@
|
|||||||
</p>
|
</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (!empty($data["license_type"])): ?>
|
<?php
|
||||||
|
$_cc2r = !empty($data["cc2r"]);
|
||||||
|
$_lic = !empty($data["license_type"]) ? $data["license_type"] : ($data["license_custom"] ?? null);
|
||||||
|
if ($_cc2r || $_lic): ?>
|
||||||
<p class="tfe-meta-item">
|
<p class="tfe-meta-item">
|
||||||
<span class="tfe-meta-label">Licence :</span>
|
<span class="tfe-meta-label">Licence :</span>
|
||||||
<?= htmlspecialchars($data["license_type"]) ?>
|
<?= htmlspecialchars(implode(", ", array_filter([$_cc2r ? "CC2r" : null, $_lic]))) ?>
|
||||||
</p>
|
</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
@@ -185,9 +188,22 @@
|
|||||||
$_contact = $data["contact_interne"];
|
$_contact = $data["contact_interne"];
|
||||||
$_isUrl = filter_var($_contact, FILTER_VALIDATE_URL) !== false;
|
$_isUrl = filter_var($_contact, FILTER_VALIDATE_URL) !== false;
|
||||||
$_isEmail = !$_isUrl && str_contains($_contact, "@");
|
$_isEmail = !$_isUrl && str_contains($_contact, "@");
|
||||||
if ($_isUrl): ?>
|
if ($_isUrl):
|
||||||
|
$_host = parse_url($_contact, PHP_URL_HOST);
|
||||||
|
$_path = parse_url($_contact, PHP_URL_PATH) ?? '';
|
||||||
|
$_isInstagram = $_host && str_contains($_host, 'instagram.com');
|
||||||
|
$_isMastodon = $_path && str_contains($_path, '/@');
|
||||||
|
if ($_isInstagram):
|
||||||
|
$_username = trim($_path, '/');
|
||||||
|
$_display = $_username ? '@' . $_username : preg_replace("#^https?://(www\.)?#i", "", rtrim($_contact, "/"));
|
||||||
|
elseif ($_isMastodon):
|
||||||
|
$_username = trim($_path, '/@');
|
||||||
|
$_display = $_username ? '@' . $_username : preg_replace("#^https?://(www\.)?#i", "", rtrim($_contact, "/"));
|
||||||
|
else:
|
||||||
|
$_display = preg_replace("#^https?://(www\.)?#i", "", rtrim($_contact, "/"));
|
||||||
|
endif; ?>
|
||||||
<a href="<?= htmlspecialchars($_contact) ?>" target="_blank" rel="noopener">
|
<a href="<?= htmlspecialchars($_contact) ?>" target="_blank" rel="noopener">
|
||||||
<?= htmlspecialchars(preg_replace("#^https?://#i", "", rtrim($_contact, "/"))) ?>
|
<?= htmlspecialchars($_display) ?>
|
||||||
<span class="sr-only">(ouvre dans un nouvel onglet)</span>
|
<span class="sr-only">(ouvre dans un nouvel onglet)</span>
|
||||||
</a>
|
</a>
|
||||||
<?php elseif ($_isEmail): ?>
|
<?php elseif ($_isEmail): ?>
|
||||||
@@ -201,7 +217,7 @@
|
|||||||
<?php if (!empty($data["baiu_link"])): ?>
|
<?php if (!empty($data["baiu_link"])): ?>
|
||||||
<?php
|
<?php
|
||||||
$_baiuHref = htmlspecialchars($data["baiu_link"]);
|
$_baiuHref = htmlspecialchars($data["baiu_link"]);
|
||||||
$_baiuLabel = preg_replace("#^https?://#i", "", rtrim($data["baiu_link"], "/"));
|
$_baiuLabel = preg_replace("#^https?://(www\\.)?#i", "", rtrim($data["baiu_link"], "/"));
|
||||||
?>
|
?>
|
||||||
<p class="tfe-meta-item">
|
<p class="tfe-meta-item">
|
||||||
<span class="tfe-meta-label">Lien :</span>
|
<span class="tfe-meta-label">Lien :</span>
|
||||||
@@ -326,9 +342,6 @@
|
|||||||
style="border:none"
|
style="border:none"
|
||||||
title="<?= $fileName ?>">
|
title="<?= $fileName ?>">
|
||||||
</iframe>
|
</iframe>
|
||||||
<p class="tfe-pdf-fallback">
|
|
||||||
<a href="<?= $mediaUrl ?>&download=1">Télécharger le PDF</a>
|
|
||||||
</p>
|
|
||||||
<?php elseif ($isWebsite): ?>
|
<?php elseif ($isWebsite): ?>
|
||||||
<iframe src="<?= $mediaUrl ?>"
|
<iframe src="<?= $mediaUrl ?>"
|
||||||
width="100%" height="700px"
|
width="100%" height="700px"
|
||||||
|
|||||||
Reference in New Issue
Block a user