Regex plus précise sur les droits

This commit is contained in:
Michael RICOIS 2009-10-16 09:45:55 +00:00
parent 420d496c69
commit 7107972254

View File

@ -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;