Support nouveau webservice

This commit is contained in:
Michael RICOIS 2011-01-13 09:47:06 +00:00
parent 8237c63d15
commit a26bb42250
2 changed files with 10 additions and 8 deletions

View File

@ -46,6 +46,7 @@ $definePerms = array(
function hasPerm($perm, $userInfos = '') function hasPerm($perm, $userInfos = '')
{ {
$return = true; $return = true;
if (is_object($userInfos)) { $userInfos = (array)$userInfos; }
if( $userInfos == '' && isset($_SESSION['tabInfo']['droits']) ){ if( $userInfos == '' && isset($_SESSION['tabInfo']['droits']) ){
$userInfos = $_SESSION['tabInfo']; $userInfos = $_SESSION['tabInfo'];
}elseif( $userInfos == '' && !isset($_SESSION['tabInfo']['droits']) || }elseif( $userInfos == '' && !isset($_SESSION['tabInfo']['droits']) ||
@ -91,7 +92,7 @@ function checkPerm($page, $perm = '')
function formElementPerm($userInfos){ function formElementPerm($userInfos){
global $definePerms, $firephp; global $definePerms, $firephp;
$return = ''; $return = '';
FB::log($userInfos, 'userInfos'); if (is_object($userInfos)) { $userInfos = (array)$userInfos; }
$listeDroits = array_key_exists('droitsClients',$userInfos) ? $listeDroits = array_key_exists('droitsClients',$userInfos) ?
explode(' ', $userInfos['droitsClients']) : array(); explode(' ', $userInfos['droitsClients']) : array();
foreach($definePerms as $perm => $infos){ foreach($definePerms as $perm => $infos){

View File

@ -7,10 +7,11 @@ $definePref = array(
'MAPPY' => array( 'init' => '', 'txt' => 'Afficher les façades d\'immeubles'), 'MAPPY' => array( 'init' => '', 'txt' => 'Afficher les façades d\'immeubles'),
'CARTES' => array( 'init' => '', 'txt' => 'Afficher les cartes et les plans'), 'CARTES' => array( 'init' => '', 'txt' => 'Afficher les cartes et les plans'),
'VOIRSURV' => array( 'init' => '', 'txt' => 'Afficher les entités sous surveillances'), 'VOIRSURV' => array( 'init' => '', 'txt' => 'Afficher les entités sous surveillances'),
); );
function hasPref($name, $userInfo = ''){ function hasPref($name, $userInfo = ''){
$return = FALSE; $return = FALSE;
if (is_object($userInfo)) { $userInfo = (array)$userInfo; }
if($userInfo == '' && isset($_SESSION['tabInfo']['pref']) ){ if($userInfo == '' && isset($_SESSION['tabInfo']['pref']) ){
$userInfo = $_SESSION['tabInfo']; $userInfo = $_SESSION['tabInfo'];
}elseif($userInfo == '' && !isset($_SESSION['tabInfo']['pref']) || }elseif($userInfo == '' && !isset($_SESSION['tabInfo']['pref']) ||