From 188e41a1d146df58624a627635d7964eecc395e9 Mon Sep 17 00:00:00 2001 From: Cerdic Date: Sun, 8 Jan 2012 17:43:37 +0000 Subject: [PATCH] =?UTF-8?q?#2415=20:=20quand=20le=20type=20pass=C3=A9=20?= =?UTF-8?q?=C3=A0=20autoriser(faire,type)=20commence=20par=20un=20=5F=20on?= =?UTF-8?q?=20ne=20le=20normalise=20pas=20par=20objet=5Ftype()=20(mais=20o?= =?UTF-8?q?n=20retire=20toujours=20tous=20les=20=5F=20pour=20composer=20le?= =?UTF-8?q?=20nom=20de=20la=20fonction)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/inc/autoriser.php | 2 +- ecrire/inc/bandeau.php | 2 +- ecrire/inc/boutons.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ecrire/inc/autoriser.php b/ecrire/inc/autoriser.php index e4cf5fb241..32dfa5d439 100644 --- a/ecrire/inc/autoriser.php +++ b/ecrire/inc/autoriser.php @@ -78,7 +78,7 @@ function autoriser_dist($faire, $type='', $id=0, $qui = NULL, $opt = NULL) { // passer par objet_type pour avoir les alias // et supprimer les _ - $type = str_replace('_','', $faire=='menu'?$type:objet_type($type,false)); + $type = str_replace('_','', strncmp($type,"_",1)==0?$type:objet_type($type,false)); // Si une exception a ete decretee plus haut dans le code, l'appliquer if (isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) diff --git a/ecrire/inc/bandeau.php b/ecrire/inc/bandeau.php index a1af3bd352..be9567af86 100644 --- a/ecrire/inc/bandeau.php +++ b/ecrire/inc/bandeau.php @@ -63,7 +63,7 @@ function definir_barre_boutons($contexte=array(),$icones = true, $autorise = tru foreach($liste_boutons as $id => $infos){ // les boutons principaux ne sont pas soumis a autorisation - if (!($parent = $infos['parent']) OR !$autorise OR autoriser('menu',$id,0,NULL,array('contexte'=>$contexte))){ + if (!($parent = $infos['parent']) OR !$autorise OR autoriser('menu',"_$id",0,NULL,array('contexte'=>$contexte))){ if ($parent AND $parent = preg_replace(',^bando_,','menu_',$parent) AND isset($boutons_admin[$parent])){ diff --git a/ecrire/inc/boutons.php b/ecrire/inc/boutons.php index f4e40b4b66..68ca857782 100644 --- a/ecrire/inc/boutons.php +++ b/ecrire/inc/boutons.php @@ -57,7 +57,7 @@ function definir_barre_onglets($script) { foreach($liste_onglets as $id => $infos){ if (($parent = $infos['parent']) && $parent == $script - && autoriser('onglet',$id)) { + && autoriser('onglet',"_$id")) { $onglets[$id] = new Bouton( find_in_theme($infos['icone']), // icone $infos['titre'], // titre