Ajout d'une sécurisation des articles de l'espace membre : lecture que pour les membres.
Mise à jour du breadcrumb pour les articles de l'espace membre
This commit is contained in:
parent
acdc3c55f0
commit
f081aef3fd
4 changed files with 108 additions and 73 deletions
|
@ -102,6 +102,20 @@ function autoriser_auteur_modifier($faire, $type, $id, $qui, $opt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function autoriser_article_lire($faire, $type, $id, $qui, $opt) {
|
||||||
|
// Si l'article fait partie de la rubrique "Espace membre", il faut être au moins rédacteur ("membre").
|
||||||
|
|
||||||
|
$id_membre = lire_config('balint/id_mots_espace_membre');
|
||||||
|
$id_mot = sql_getfetsel('id_mot','spip_mots','id_groupe='. $id_membre);
|
||||||
|
if (in_array($id_mot, $opt)){
|
||||||
|
return in_array($qui['statut'], array('0minirezo','1comite'));
|
||||||
|
}
|
||||||
|
// Sinon il faut être admin
|
||||||
|
else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function autoriser_article_modifier($faire, $type, $id, $qui, $opt) {
|
function autoriser_article_modifier($faire, $type, $id, $qui, $opt) {
|
||||||
|
|
||||||
if(in_array($qui['id_auteur'],auteurs_objet('article',$id))){
|
if(in_array($qui['id_auteur'],auteurs_objet('article',$id))){
|
||||||
|
|
|
@ -2,16 +2,24 @@
|
||||||
#SET{mots,#ARRAY}
|
#SET{mots,#ARRAY}
|
||||||
#SET{id_groupe, #INFO_ID_GROUPE{article,#ENV{id_article}}}
|
#SET{id_groupe, #INFO_ID_GROUPE{article,#ENV{id_article}}}
|
||||||
|
|
||||||
|
[(#REM On récupère : tous les mots / les mots de la rubrique médiathèque / les mots de la rubrique espace membre )]
|
||||||
<BOUCLE_mots(MOTS){id_article=#ENV{id_article}}>
|
<BOUCLE_mots(MOTS){id_article=#ENV{id_article}}>
|
||||||
[(#SET{mots,#GET{mots}|push{#TITRE}})]
|
[(#SET{mots,#GET{mots}|push{#TITRE}})]
|
||||||
[(#TYPE|=={Médiathèque}|oui)
|
[(#TYPE|=={Médiathèque}|oui)
|
||||||
#SET{id_media,#ID_MOT}
|
#SET{id_media,#ID_MOT}
|
||||||
]
|
]
|
||||||
|
[(#TYPE|=={Espace Membre}|oui)
|
||||||
|
#SET{id_membre,#ID_MOT}
|
||||||
|
]
|
||||||
</BOUCLE_mots>
|
</BOUCLE_mots>
|
||||||
|
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="#URL_SITE_SPIP"><:accueil_site:></a><span class="divider"> > </span></li>
|
<li><a href="#URL_SITE_SPIP"><:accueil_site:></a><span class="divider"> > </span></li>
|
||||||
|
|
||||||
|
[(#GET{id_membre}|oui)
|
||||||
|
<li><a href="[(#URL_PAGE{espace_membre}|parametre_url{id_mot,#GET{id_membre}})]"> #INFO_TITRE{mot,#GET{id_membre}}</a><span class="divider"> > </span></li>
|
||||||
|
]
|
||||||
|
[(#GET{id_membre}|non)
|
||||||
[(#GET{mots}|find{Séminaires}|oui)
|
[(#GET{mots}|find{Séminaires}|oui)
|
||||||
<li><a href="#URL_PAGE{seminaires}"> Séminaires</a><span class="divider"> > </span></li>
|
<li><a href="#URL_PAGE{seminaires}"> Séminaires</a><span class="divider"> > </span></li>
|
||||||
]
|
]
|
||||||
|
@ -28,6 +36,7 @@
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
]
|
||||||
|
|
||||||
<li class='active'>[(#INFO_TITRE{article,#ENV{id_article}}|couper{80})]</li>
|
<li class='active'>[(#INFO_TITRE{article,#ENV{id_article}}|couper{80})]</li>
|
||||||
|
|
||||||
|
|
|
@ -4,75 +4,20 @@
|
||||||
|
|
||||||
<BOUCLE_article(ARTICLES){id_article}{statut}>
|
<BOUCLE_article(ARTICLES){id_article}{statut}>
|
||||||
|
|
||||||
|
|
||||||
<section class="section-top section-bottom container">
|
<section class="section-top section-bottom container">
|
||||||
|
|
||||||
<div class="cadre-blanc">
|
<div class="cadre-blanc">
|
||||||
|
|
||||||
<INCLURE{fond=breadcrumb/article,env} />
|
#SET{mots,#ARRAY}
|
||||||
|
<BOUCLE_mots(MOTS){id_article}>
|
||||||
[(#AUTORISER{modifier, article, #ID_ARTICLE})
|
[(#SET{mots,#GET{mots}|push{#ID_MOT}})]
|
||||||
<div class="boutons a-droite">
|
|
||||||
<a class="btn" href="#URL_PAGE{editer_article,id_article=#ID_ARTICLE }"><i class="fas fa-edit"></i> Éditer</a>
|
|
||||||
</div>
|
|
||||||
]
|
|
||||||
|
|
||||||
<div class="contenu-article row">
|
|
||||||
|
|
||||||
<div class="col-lg-8">
|
|
||||||
<h1 class="h2">#TITRE</h1>
|
|
||||||
[<h2 class="h5 font-italic">(#SOUSTITRE)</h2>]
|
|
||||||
[(#DATE_AGENDA|oui)
|
|
||||||
<strong class="h5">#DATE_AGENDA</strong>
|
|
||||||
]
|
|
||||||
|
|
||||||
[(#REM) On n'affiche plus la date.
|
|
||||||
[(#DATE_AGENDA|non)
|
|
||||||
<strong class="h5 #EDIT{date}">[(#DATE|affdate_jourcourt)]</strong>
|
|
||||||
]
|
|
||||||
]
|
|
||||||
|
|
||||||
<div class="Texte">
|
|
||||||
|
|
||||||
<div class="texte">#TEXTE</div>
|
|
||||||
|
|
||||||
<B_mots>
|
|
||||||
<div class="mots">
|
|
||||||
[(#REM) afficher mots-clés et tags dont le groupe est "important" ]
|
|
||||||
<BOUCLE_mots(MOTS){id_article}{si #CONFIG{balint/tags_article}|!={non}}{id_groupe IN #GET{grpes_importants}}>
|
|
||||||
<a href="[(#URL_MOT)]" class="tag tags mrs[ (#ID_GROUPE|=={#GET{id_grpe_tags}}|?{hashtag,mot_cle})]"
|
|
||||||
data-id_mot="#ID_MOT" title="Les biens liées au[ (#ID_GROUPE|=={#GET{id_grpe_tags}}|?{tag,mot clé}) ]#TITRE">
|
|
||||||
<i class="fas fa-[(#ID_GROUPE|=={#GET{id_grpe_tags}}|?{hashtag,tag})]"></i>#TITRE
|
|
||||||
</a>
|
|
||||||
</BOUCLE_mots>
|
</BOUCLE_mots>
|
||||||
</div>
|
[(#AUTORISER{lire, article, #ID_ARTICLE,'',#GET{mots}}|?{
|
||||||
</B_mots>
|
<INCLURE{fond=inclure/article_contenu,env}> ,
|
||||||
|
<div class="reponse_formulaire reponse_formulaire_erreur">Votre n'avez pas l'autorisation de lire cet article.</div>
|
||||||
|
})]
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-lg-4">
|
|
||||||
<B_docs>
|
|
||||||
<div class="row liste-documents">
|
|
||||||
<BOUCLE_docs(DOCUMENTS){id_article=#ID_ARTICLE}{extension==pdf|doc|docx|odt|xls|xlsx}>
|
|
||||||
<div class="col">
|
|
||||||
<a href="#FICHIER">
|
|
||||||
[(#LOGO_DOCUMENT|image_reduire{0,120})]
|
|
||||||
[<div class="titre_img #EDIT{titre}">(#TITRE)</div>]
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</BOUCLE_docs>
|
|
||||||
</div>
|
|
||||||
</B_docs>
|
|
||||||
<BOUCLE_images(DOCUMENTS){id_article=#ID_ARTICLE}{extension==jpg|png|gif}{!par credits}>
|
|
||||||
<a href="#FICHIER" class='photo-article mediabox' rel='galerie_#ID_ARTICLE'>
|
|
||||||
[(#FICHIER|balise_img{#TITRE}|image_reduire{540, 540})]
|
|
||||||
[<div class="titre_img #EDIT{titre}">(#TITRE)</div>]
|
|
||||||
</a>
|
|
||||||
</BOUCLE_images>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
67
inclure/article_contenu.html
Normal file
67
inclure/article_contenu.html
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
<BOUCLE_article(ARTICLES){id_article}>
|
||||||
|
|
||||||
|
<INCLURE{fond=breadcrumb/article,env} />
|
||||||
|
|
||||||
|
[(#AUTORISER{modifier, article, #ID_ARTICLE})
|
||||||
|
<div class="boutons a-droite">
|
||||||
|
<a class="btn" href="#URL_PAGE{editer_article,id_article=#ID_ARTICLE }"><i class="fas fa-edit"></i> Éditer</a>
|
||||||
|
</div>
|
||||||
|
]
|
||||||
|
|
||||||
|
<div class="contenu-article row">
|
||||||
|
|
||||||
|
<div class="col-lg-8">
|
||||||
|
<h1 class="h2">#TITRE</h1>
|
||||||
|
[<h2 class="h5 font-italic">(#SOUSTITRE)</h2>]
|
||||||
|
[(#DATE_AGENDA|oui)
|
||||||
|
<strong class="h5">#DATE_AGENDA</strong>
|
||||||
|
]
|
||||||
|
|
||||||
|
[(#REM) On n'affiche plus la date.
|
||||||
|
[(#DATE_AGENDA|non)
|
||||||
|
<strong class="h5 #EDIT{date}">[(#DATE|affdate_jourcourt)]</strong>
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
<div class="Texte">
|
||||||
|
|
||||||
|
<div class="texte">#TEXTE</div>
|
||||||
|
|
||||||
|
<B_mots>
|
||||||
|
<div class="mots">
|
||||||
|
[(#REM) afficher mots-clés et tags dont le groupe est "important" ]
|
||||||
|
<BOUCLE_mots(MOTS){id_article}{si #CONFIG{balint/tags_article}|!={non}}{id_groupe IN #GET{grpes_importants}}>
|
||||||
|
<a href="[(#URL_MOT)]" class="tag tags mrs[ (#ID_GROUPE|=={#GET{id_grpe_tags}}|?{hashtag,mot_cle})]"
|
||||||
|
data-id_mot="#ID_MOT" title="Les biens liées au[ (#ID_GROUPE|=={#GET{id_grpe_tags}}|?{tag,mot clé}) ]#TITRE">
|
||||||
|
<i class="fas fa-[(#ID_GROUPE|=={#GET{id_grpe_tags}}|?{hashtag,tag})]"></i>#TITRE
|
||||||
|
</a>
|
||||||
|
</BOUCLE_mots>
|
||||||
|
</div>
|
||||||
|
</B_mots>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<B_docs>
|
||||||
|
<div class="row liste-documents">
|
||||||
|
<BOUCLE_docs(DOCUMENTS){id_article=#ID_ARTICLE}{extension==pdf|doc|docx|odt|xls|xlsx}>
|
||||||
|
<div class="col">
|
||||||
|
<a href="#FICHIER">
|
||||||
|
[(#LOGO_DOCUMENT|image_reduire{0,120})]
|
||||||
|
[<div class="titre_img #EDIT{titre}">(#TITRE)</div>]
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</BOUCLE_docs>
|
||||||
|
</div>
|
||||||
|
</B_docs>
|
||||||
|
<BOUCLE_images(DOCUMENTS){id_article=#ID_ARTICLE}{extension==jpg|png|gif}{!par credits}>
|
||||||
|
<a href="#FICHIER" class='photo-article mediabox' rel='galerie_#ID_ARTICLE'>
|
||||||
|
[(#FICHIER|balise_img{#TITRE}|image_reduire{540, 540})]
|
||||||
|
[<div class="titre_img #EDIT{titre}">(#TITRE)</div>]
|
||||||
|
</a>
|
||||||
|
</BOUCLE_images>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</BOUCLE_article>
|
Loading…
Add table
Reference in a new issue