Skip to content
Extraits de code Groupes Projets
Valider 3ccd09b1 rédigé par cerdic's avatar cerdic
Parcourir les fichiers

fix: suite à #20 les appels à autoriser(voir, document,xx) doivent ajouter...

fix: suite à #20 les appels à autoriser(voir, document,xx) doivent ajouter l'option htaccess si ils se contentaient avant d'une valeur non false
parent 6b91414b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -105,7 +105,7 @@ function accesrestreint_page_indisponible($contexte) { ...@@ -105,7 +105,7 @@ function accesrestreint_page_indisponible($contexte) {
} }
include_spip('inc/autoriser'); include_spip('inc/autoriser');
if ($publie and !autoriser('voir', $objet, $id)) { if ($publie and !autoriser('voir', $objet, $id, null, $objet === 'document' ? ['htaccess' => true]: [])) {
// c'est un contenu restreint // c'est un contenu restreint
$contexte['status'] = '401'; $contexte['status'] = '401';
$contexte['code'] = '401 Unauthorized'; $contexte['code'] = '401 Unauthorized';
......
...@@ -450,7 +450,7 @@ class Accesrestreint_document { ...@@ -450,7 +450,7 @@ class Accesrestreint_document {
include_spip('inc/autoriser'); include_spip('inc/autoriser');
} }
if (!autoriser('voir', 'document', $doc['id_document'])) { if (!autoriser('voir', 'document', $doc['id_document'], null, ['htaccess' => true])) {
spip_log('acces interdit, pas autorise a voir le document #' . $doc['id_document'] . ' : ' . $this->_fichier, 'accesrestreint'); spip_log('acces interdit, pas autorise a voir le document #' . $doc['id_document'] . ' : ' . $this->_fichier, 'accesrestreint');
return false; return false;
} }
......
...@@ -24,7 +24,7 @@ function action_autoriser_dist() { ...@@ -24,7 +24,7 @@ function action_autoriser_dist() {
$arg = intval(_request('arg')); $arg = intval(_request('arg'));
if ( if (
!autoriser('voir', 'document', $arg) !autoriser('voir', 'document', $arg, null, ['htaccess' => true])
or !($row = sql_fetsel('fichier', 'spip_documents', 'id_document=' . intval($arg))) or !($row = sql_fetsel('fichier', 'spip_documents', 'id_document=' . intval($arg)))
or !($file = $row['fichier']) or !($file = $row['fichier'])
or !(file_exists($file)) or !(file_exists($file))
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter