From 7107972254a02d935ef852aae7b254edc436cd2a Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 16 Oct 2009 09:45:55 +0000 Subject: [PATCH] =?UTF-8?q?Regex=20plus=20pr=C3=A9cise=20sur=20les=20droit?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/menu/menu.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/menu/menu.php b/includes/menu/menu.php index 7601895c9..f19c188de 100644 --- a/includes/menu/menu.php +++ b/includes/menu/menu.php @@ -83,10 +83,10 @@ $children[] = array('data' => 'IndiScore ©', $children[] = array('data' => 'IndiScore + ©', 'href' => 'menu_href_indiscoreplus'); $children[] = array('data' => 'Rapport synthétique', - 'href' => 'menu_href_rsynthesemin',); + 'href' => 'menu_href_rsynthesemin', 'perm' => array( 'name'=>'INDISCORE2', 'hidden'=>true ) ); $children[] = array('data' => 'Rapport complet', - 'href' => 'menu_href_rsynthese',); + 'href' => 'menu_href_rsynthese', 'perm' => array( 'name'=>'INDISCORE3', 'hidden'=>true ) ); $children[] = array('data' => 'Scoring Credit Safe ©', 'href' => 'menu_href_creditsafe', @@ -138,12 +138,12 @@ function menu() $href = $children['href'](); if( isset($children['perm']) ) { - if( !preg_match('/'.$children['perm']['name'].'/i', $_SESSION['tabInfo']['droits']) && + if( !preg_match('/'.$children['perm']['name'].'\b/i', $_SESSION['tabInfo']['droits']) && (!isset($children['perm']['hidden']) || $children['perm']['hidden']===false) ) { $href = '#'; } - elseif( !preg_match('/'.$children['perm']['name'].'/i', $_SESSION['tabInfo']['droits']) && + elseif( !preg_match('/'.$children['perm']['name'].'\b/i', $_SESSION['tabInfo']['droits']) && isset($children['perm']['hidden']) && $children['perm']['hidden']===true ) { $href = false;