feat: avant-premiere - article visible en liste mais verrouille avant sa date de publication
This commit is contained in:
+8
-1
@@ -69,7 +69,7 @@ switch ($action) {
|
||||
}
|
||||
|
||||
if (!$article['published']) {
|
||||
$author = $article['author'] ?? '';
|
||||
$author = $article['author'] ?? '';
|
||||
$currentEmail = currentUserEmail() ?? '';
|
||||
$canView = ($author !== '' && $currentEmail === $author)
|
||||
|| ($author === '' && isAdmin());
|
||||
@@ -80,6 +80,13 @@ switch ($action) {
|
||||
}
|
||||
}
|
||||
|
||||
// Avant-première : publié mais date future → contenu verrouillé
|
||||
if ($article['published'] && strtotime((string)($article['published_at'] ?? '')) > time()) {
|
||||
http_response_code(404);
|
||||
echo 'Article introuvable.';
|
||||
exit;
|
||||
}
|
||||
|
||||
$files = $articles->getFiles($article['uuid']);
|
||||
|
||||
// Résout les chemins de fichiers relatifs dans le contenu
|
||||
|
||||
Reference in New Issue
Block a user