mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
link creation: fieldset with checkboxes for objet restriction, TFE checked by default
link creation: fieldset with checkboxes for objet restriction, TFE checked by default; password/expiration in second fieldset 'Accès'
This commit is contained in:
@@ -32,8 +32,10 @@ switch ($action) {
|
||||
App::redirect('/admin/acces.php', error: "La date d'expiration doit être dans le futur.");
|
||||
}
|
||||
}
|
||||
$objetRaw = $_POST['objet_restriction'] ?? '';
|
||||
$objetRestriction = in_array($objetRaw, ['tfe', 'thèse', 'frart'], true) ? $objetRaw : null;
|
||||
$objetRaw = $_POST['objet_restriction'] ?? ['tfe'];
|
||||
$validObjet = ['tfe', 'thèse', 'frart'];
|
||||
$selected = is_array($objetRaw) ? array_intersect($objetRaw, $validObjet) : [];
|
||||
$objetRestriction = !empty($selected) ? implode(',', $selected) : 'tfe';
|
||||
$link = $shareLink->create(1, $password, $expiresAt, $objetRestriction);
|
||||
$logger->logLinkCreate(
|
||||
$link['slug'] ?? '',
|
||||
|
||||
Reference in New Issue
Block a user