64 lines
1.6 KiB
PHP
64 lines
1.6 KiB
PHP
<?php
|
|
/*
|
|
* Définition en dur des spécificitées des clients
|
|
* Surcharge des droits et des préférences (util en mode développement)
|
|
*/
|
|
|
|
//Ne pas afficher droits -
|
|
//Ne pas afficher préférence -
|
|
//Ajouter le droits -
|
|
//Ajouter la préfé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(){} |