64 lines
1.6 KiB
PHP
64 lines
1.6 KiB
PHP
|
<?php
|
|||
|
/*
|
|||
|
* D<EFBFBD>finition en dur des sp<EFBFBD>cificit<EFBFBD>es des clients
|
|||
|
* Surcharge des droits et des pr<EFBFBD>f<EFBFBD>rences (util en mode d<EFBFBD>veloppement)
|
|||
|
*/
|
|||
|
|
|||
|
//Ne pas afficher droits -
|
|||
|
//Ne pas afficher pr<70>f<EFBFBD>rence -
|
|||
|
//Ajouter le droits -
|
|||
|
//Ajouter la pr<70>f<EFBFBD>rence -
|
|||
|
|
|||
|
function overridePermByidClient($perm){
|
|||
|
$perm = strtoupper($perm);
|
|||
|
$idClient = $_SESSION['tabInfo']['idClient'];
|
|||
|
$onlyAuthorizedPerm = array();
|
|||
|
$notAuthorizedPerm = array(
|
|||
|
'ACTES' => array(18),
|
|||
|
'IPARI' => array(18),
|
|||
|
'MARQUES' => array(18),
|
|||
|
'SCORECSF' => array(18),
|
|||
|
);
|
|||
|
|
|||
|
if( isset($onlyAuthorizedPerm[$perm]) ){
|
|||
|
foreach($onlyAuthorizedPerm[$perm] as $id){
|
|||
|
if($idClient == $id){ $return = TRUE; break; }
|
|||
|
else{ $return = FALSE; }
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if( isset($notAuthorizedPerm[$perm]) && !isset($return) ){
|
|||
|
foreach($notAuthorizedPerm[$perm] as $id){
|
|||
|
if($idClient == $id){ $return = FALSE; break; }
|
|||
|
else{ $return = TRUE; }
|
|||
|
}
|
|||
|
}
|
|||
|
return $return;
|
|||
|
}
|
|||
|
|
|||
|
function overridePermByLogin($perm, $login = ''){
|
|||
|
$perm = strtoupper($perm);
|
|||
|
if($login == ''){ $_SESSION['tabInfo']['login']; }
|
|||
|
$onlyAuthorizedPerm = array(
|
|||
|
'KBIS' => array('ylenaour', 'jmartory', 'mheitz', 'mricois'),
|
|||
|
);
|
|||
|
$notAuthorizedPerm = array();
|
|||
|
|
|||
|
if( isset($onlyAuthorizedPerm[$perm]) ){
|
|||
|
foreach($onlyAuthorizedPerm[$perm] as $user){
|
|||
|
if($login == $user){ $return = TRUE; break; }
|
|||
|
else{ $return = FALSE; }
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if( isset($notAuthorizedPerm[$perm]) && !isset($return) ){
|
|||
|
foreach($notAuthorizedPerm[$perm] as $user){
|
|||
|
if($login == $user){ $return = FALSE; break; }
|
|||
|
else{ $return = TRUE; }
|
|||
|
}
|
|||
|
}
|
|||
|
return $return;
|
|||
|
}
|
|||
|
|
|||
|
function overridePrefByidClient(){}
|
|||
|
function overridePrefByLogin(){}
|