Skip to content
Extraits de code Groupes Projets
Valider 1a7bf31c rédigé par esj's avatar esj
Parcourir les fichiers

les admins restreints ne voyaient pas les mots cles mais pouvaient les changer...

les admins restreints ne voyaient pas les mots cles mais pouvaient les changer en executant directementle script; maintenant c'est l'inverse, heureusement
parent 5d680986
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -146,7 +146,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, ...@@ -146,7 +146,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot,
echo "<a name='mots'></a>"; echo "<a name='mots'></a>";
if ($flag_editable){ if ($flag_editable){
if ($nouv_mot.$cherche_mot.$supp_mot) if ($nouv_mot||$cherche_mot||$supp_mot)
$bouton = bouton_block_visible("lesmots"); $bouton = bouton_block_visible("lesmots");
else else
$bouton = bouton_block_invisible("lesmots"); $bouton = bouton_block_invisible("lesmots");
...@@ -158,7 +158,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, ...@@ -158,7 +158,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot,
// //
if ($nouv_mot) if ($nouv_mot)
$nouveaux_mots[] = $nouv_mot; $nouveaux_mots = array($nouv_mot);
$tous_les_mots = split(" *[,;] *", $cherche_mot); $tous_les_mots = split(" *[,;] *", $cherche_mot);
while ((list(,$cherche_mot) = each ($tous_les_mots)) AND $cherche_mot) { while ((list(,$cherche_mot) = each ($tous_les_mots)) AND $cherche_mot) {
...@@ -244,7 +244,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, ...@@ -244,7 +244,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot,
fin_boite_info(); fin_boite_info();
echo "<P>"; echo "<P>";
} } // fin de la boucle sur la recherche de mots
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
...@@ -283,10 +283,6 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, ...@@ -283,10 +283,6 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot,
// Afficher les mots-cles // Afficher les mots-cles
// //
$query = "SELECT DISTINCT type FROM spip_mots";
$result = spip_query($query);
$plusieurs_types = (spip_num_rows($result) > 1);
unset($les_mots); unset($les_mots);
$query = "SELECT mots.* FROM spip_mots AS mots, spip_mots_$table AS lien WHERE lien.$id_table=$id_objet AND mots.id_mot=lien.id_mot ORDER BY mots.type, mots.titre"; $query = "SELECT mots.* FROM spip_mots AS mots, spip_mots_$table AS lien WHERE lien.$id_table=$id_objet AND mots.id_mot=lien.id_mot ORDER BY mots.type, mots.titre";
...@@ -369,12 +365,12 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, ...@@ -369,12 +365,12 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot,
$vals[] = "$type_mot"; $vals[] = "$type_mot";
if ($flag_editable){ if ($flag_editable){
$s = "";
if ($flag_groupe) if ($flag_groupe)
$s .= "<A HREF=\"$url_base&supp_mot=$id_mot#mots\">"._T('info_retirer_mot')."&nbsp;" . http_img_pack('croix-rouge.gif', "X", "width='7' height='7' border='0' align='middle'") ."</A>"; $s = "<A HREF=\"$url_base&supp_mot=$id_mot#mots\">"._T('info_retirer_mot')."&nbsp;" . http_img_pack('croix-rouge.gif', "X", "width='7' height='7' border='0' align='middle'") ."</A>";
else $s .= "&nbsp;"; else $s = "&nbsp;";
} $vals[] = $s;
$vals[] = $s; } else $vals[]= "";
$tableau[] = $vals; $tableau[] = $vals;
...@@ -545,7 +541,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot, ...@@ -545,7 +541,7 @@ function formulaire_mots($table, $id_objet, $nouv_mot, $supp_mot, $cherche_mot,
} }
function afficher_groupe_mots($id_groupe) { function afficher_groupe_mots($id_groupe) {
global $connect_id_auteur, $connect_statut; global $connect_id_auteur, $connect_statut, $connect_toutes_rubriques;
global $spip_lang_right; global $spip_lang_right;
$query = "SELECT id_mot, titre, ".creer_objet_multi ("titre", "$spip_lang")." FROM spip_mots WHERE id_groupe = '$id_groupe' ORDER BY multi"; $query = "SELECT id_mot, titre, ".creer_objet_multi ("titre", "$spip_lang")." FROM spip_mots WHERE id_groupe = '$id_groupe' ORDER BY multi";
...@@ -635,7 +631,7 @@ function afficher_groupe_mots($id_groupe) { ...@@ -635,7 +631,7 @@ function afficher_groupe_mots($id_groupe) {
$vals[] = $texte_lie; $vals[] = $texte_lie;
if ($connect_statut=="0minirezo") { if ($connect_statut=="0minirezo" AND $connect_toutes_rubriques) {
$vals[] = "<div style='text-align:right;'><a href='mots_tous.php3?conf_mot=$id_mot'>"._T('info_supprimer_mot')."&nbsp;<img src='" . _DIR_IMG_PACK . "croix-rouge.gif' alt='X' width='7' height='7' border='0' align='bottom' /></a></div>"; $vals[] = "<div style='text-align:right;'><a href='mots_tous.php3?conf_mot=$id_mot'>"._T('info_supprimer_mot')."&nbsp;<img src='" . _DIR_IMG_PACK . "croix-rouge.gif' alt='X' width='7' height='7' border='0' align='bottom' /></a></div>";
} }
......
...@@ -659,8 +659,8 @@ function puce_statut_article($id, $statut, $id_rubrique) { ...@@ -659,8 +659,8 @@ function puce_statut_article($id, $statut, $id_rubrique) {
return $inser_puce; return $inser_puce;
} }
function puce_statut_breve($id, $statut, $type, $id_rubrique=0) { function puce_statut_breve($id, $statut, $type, $droit) {
global $spip_lang_left, $dir_lang, $connect_statut, $options; global $spip_lang_left, $dir_lang;
$puces = array( $puces = array(
0 => 'puce-orange-breve.gif', 0 => 'puce-orange-breve.gif',
...@@ -693,8 +693,7 @@ function puce_statut_breve($id, $statut, $type, $id_rubrique=0) { ...@@ -693,8 +693,7 @@ function puce_statut_breve($id, $statut, $type, $id_rubrique=0) {
$type1 = "statut$type$id"; $type1 = "statut$type$id";
$inser_puce = http_img_pack($puce, "", "id='img$type1' border='0' style='margin: 1px;'"); $inser_puce = http_img_pack($puce, "", "id='img$type1' border='0' style='margin: 1px;'");
if (!($connect_statut == '0minirezo' AND $options == 'avancees' AND acces_rubrique($id_rubrique))) if (!$droit) return $inser_puce;
return $inser_puce;
$type2 = "statutdecal$type$id"; $type2 = "statutdecal$type$id";
$action = "onmouseover=\"montrer('$type2');\"\n"; $action = "onmouseover=\"montrer('$type2');\"\n";
...@@ -1187,8 +1186,7 @@ function afficher_articles_trad($titre_table, $requete, $afficher_visites = fals ...@@ -1187,8 +1186,7 @@ function afficher_articles_trad($titre_table, $requete, $afficher_visites = fals
function afficher_breves($titre_table, $requete, $affrub=false) { function afficher_breves($titre_table, $requete, $affrub=false) {
global $connect_id_auteur, $spip_lang_right, $spip_lang_left, $dir_lang, $couleur_claire, $couleur_foncee; global $connect_id_auteur, $spip_lang_right, $spip_lang_left, $dir_lang, $couleur_claire, $couleur_foncee;
global $options; global $connect_statut, $options;
if ((lire_meta('multi_rubriques') == 'oui' AND $GLOBALS['id_rubrique'] == 0) OR lire_meta('multi_articles') == 'oui') { if ((lire_meta('multi_rubriques') == 'oui' AND $GLOBALS['id_rubrique'] == 0) OR lire_meta('multi_articles') == 'oui') {
...@@ -1219,6 +1217,7 @@ function afficher_breves($titre_table, $requete, $affrub=false) { ...@@ -1219,6 +1217,7 @@ function afficher_breves($titre_table, $requete, $affrub=false) {
$result = spip_query($requete); $result = spip_query($requete);
$table = ''; $table = '';
$droit = ($connect_statut == '0minirezo' && $options == 'avancees');
while ($row = spip_fetch_array($result)) { while ($row = spip_fetch_array($result)) {
$vals = ''; $vals = '';
...@@ -1230,7 +1229,7 @@ function afficher_breves($titre_table, $requete, $affrub=false) { ...@@ -1230,7 +1229,7 @@ function afficher_breves($titre_table, $requete, $affrub=false) {
if ($lang = $row['lang']) changer_typo($lang); if ($lang = $row['lang']) changer_typo($lang);
$id_rubrique = $row['id_rubrique']; $id_rubrique = $row['id_rubrique'];
$vals[] = puce_statut_breve($id_breve, $statut, 'breve', $id_rubrique); $vals[] = puce_statut_breve($id_breve, $statut, 'breve', ($droit && acces_rubrique($id_rubrique)), $id_rubrique);
$s = "<div>"; $s = "<div>";
$s .= "<a href='breves_voir.php3?id_breve=$id_breve'$dir_lang style=\"display:block;\">"; $s .= "<a href='breves_voir.php3?id_breve=$id_breve'$dir_lang style=\"display:block;\">";
......
...@@ -20,7 +20,7 @@ include_ecrire ("inc_abstract_sql.php3"); ...@@ -20,7 +20,7 @@ include_ecrire ("inc_abstract_sql.php3");
// //
// modifications mot // modifications mot
// //
if ($connect_statut == '0minirezo') { if ($connect_statut == '0minirezo' AND $connect_toutes_rubriques) {
if ($supp_mot) { if ($supp_mot) {
$query = "DELETE FROM spip_mots WHERE id_mot=$supp_mot"; $query = "DELETE FROM spip_mots WHERE id_mot=$supp_mot";
$result = spip_query($query); $result = spip_query($query);
...@@ -123,7 +123,7 @@ echo "</center>"; ...@@ -123,7 +123,7 @@ echo "</center>";
// Logos du mot-clef // Logos du mot-clef
// //
if ($id_mot > 0 AND $connect_statut == '0minirezo') if ($id_mot > 0 AND $connect_statut == '0minirezo' AND $connect_toutes_rubriques)
afficher_boite_logo('mot', 'id_mot', $id_mot, afficher_boite_logo('mot', 'id_mot', $id_mot,
_T('logo_mot_cle').aide("breveslogo"), _T('logo_survol')); _T('logo_mot_cle').aide("breveslogo"), _T('logo_survol'));
...@@ -135,7 +135,7 @@ debut_raccourcis(); ...@@ -135,7 +135,7 @@ debut_raccourcis();
icone_horizontale(_T('icone_voir_tous_mots_cles'), "mots_tous.php3", "mot-cle-24.gif", "rien.gif"); icone_horizontale(_T('icone_voir_tous_mots_cles'), "mots_tous.php3", "mot-cle-24.gif", "rien.gif");
if ($connect_statut == '0minirezo') if ($connect_statut == '0minirezo' AND $connect_toutes_rubriques)
icone_horizontale(_T('icone_creation_mots_cles'), "mots_edit.php3?new=oui&redirect=mots_tous.php3&id_groupe=$id_groupe", "mot-cle-24.gif", "creer.gif"); icone_horizontale(_T('icone_creation_mots_cles'), "mots_edit.php3?new=oui&redirect=mots_tous.php3&id_groupe=$id_groupe", "mot-cle-24.gif", "creer.gif");
fin_raccourcis(); fin_raccourcis();
...@@ -202,7 +202,7 @@ fin_cadre_relief(); ...@@ -202,7 +202,7 @@ fin_cadre_relief();
if ($connect_statut =="0minirezo"){ if ($connect_statut =="0minirezo" AND $connect_toutes_rubriques){
echo "<P>"; echo "<P>";
debut_cadre_formulaire(); debut_cadre_formulaire();
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
include ("inc.php3"); include ("inc.php3");
include_ecrire("inc_mots.php3"); include_ecrire("inc_mots.php3");
// secure
if (!($connect_statut == '0minirezo' AND $connect_toutes_rubriques))
$conf_mot = "";
// suppression d'un mot ? // suppression d'un mot ?
if ($conf_mot = intval($conf_mot)) { if ($conf_mot = intval($conf_mot)) {
$query = "SELECT * FROM spip_mots WHERE id_mot='$conf_mot'"; $query = "SELECT * FROM spip_mots WHERE id_mot='$conf_mot'";
...@@ -56,7 +60,7 @@ if ($conf_mot = intval($conf_mot)) { ...@@ -56,7 +60,7 @@ if ($conf_mot = intval($conf_mot)) {
} }
if ($connect_statut == '0minirezo') { if ($connect_statut == '0minirezo' AND $connect_toutes_rubriques) {
if ($modifier_groupe == "oui") { if ($modifier_groupe == "oui") {
$change_type = addslashes(corriger_caracteres($change_type)); $change_type = addslashes(corriger_caracteres($change_type));
$ancien_type = addslashes(corriger_caracteres($ancien_type)); $ancien_type = addslashes(corriger_caracteres($ancien_type));
...@@ -82,7 +86,7 @@ if ($connect_statut == '0minirezo') { ...@@ -82,7 +86,7 @@ if ($connect_statut == '0minirezo') {
$query="DELETE FROM spip_groupes_mots WHERE id_groupe='$supp_group'"; $query="DELETE FROM spip_groupes_mots WHERE id_groupe='$supp_group'";
$result=spip_query($query); $result=spip_query($query);
} }
} }
debut_page(_T('titre_page_mots_tous'), "documents", "mots"); debut_page(_T('titre_page_mots_tous'), "documents", "mots");
...@@ -91,7 +95,10 @@ debut_gauche(); ...@@ -91,7 +95,10 @@ debut_gauche();
debut_droite(); debut_droite();
gros_titre(_T('titre_mots_tous')); gros_titre(_T('titre_mots_tous'));
echo typo(_T('info_creation_mots_cles')) . aide ("mots") . "<br><br>"; if ($connect_statut == '0minirezo' AND $connect_toutes_rubriques) {
echo typo(_T('info_creation_mots_cles')) . aide ("mots") ;
}
echo "<br><br>";
///// /////
...@@ -242,7 +249,7 @@ while ($row_groupes = spip_fetch_array($result_groupes)) { ...@@ -242,7 +249,7 @@ while ($row_groupes = spip_fetch_array($result_groupes)) {
// //
$supprimer_groupe = afficher_groupe_mots($id_groupe); $supprimer_groupe = afficher_groupe_mots($id_groupe);
if ($connect_statut =="0minirezo" AND !$conf_mot){ if ($connect_statut =="0minirezo" AND $connect_toutes_rubriques AND !$conf_mot){
echo "\n<table cellpadding=0 cellspacing=0 border=0 width=100%>"; echo "\n<table cellpadding=0 cellspacing=0 border=0 width=100%>";
echo "<tr>"; echo "<tr>";
echo "<td>"; echo "<td>";
...@@ -264,7 +271,7 @@ while ($row_groupes = spip_fetch_array($result_groupes)) { ...@@ -264,7 +271,7 @@ while ($row_groupes = spip_fetch_array($result_groupes)) {
fin_cadre_enfonce(); fin_cadre_enfonce();
} }
if ($connect_statut =="0minirezo" AND !$conf_mot){ if ($connect_statut =="0minirezo" AND $connect_toutes_rubriques AND !$conf_mot){
echo "<p>&nbsp;</p><div align='right'>"; echo "<p>&nbsp;</p><div align='right'>";
icone(_T('icone_creation_groupe_mots'), "mots_type.php3?new=oui", "groupe-mot-24.gif", "creer.gif"); icone(_T('icone_creation_groupe_mots'), "mots_type.php3?new=oui", "groupe-mot-24.gif", "creer.gif");
echo "</div>"; echo "</div>";
......
...@@ -244,7 +244,7 @@ echo "</table>\n"; ...@@ -244,7 +244,7 @@ echo "</table>\n";
/// Mots-cles /// Mots-cles
if ($flag_mots!= 'non' AND $flag_editable AND $options == 'avancees' AND $id_rubrique > 0) { if ($flag_mots!= 'non' AND $id_rubrique > 0) {
echo "\n<p>"; echo "\n<p>";
formulaire_mots('rubriques', $id_rubrique, $nouv_mot, $supp_mot, $cherche_mot, $flag_editable); formulaire_mots('rubriques', $id_rubrique, $nouv_mot, $supp_mot, $cherche_mot, $flag_editable);
} }
......
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