Même code que la version 0.5

This commit is contained in:
Michael RICOIS 2012-01-21 20:26:02 +00:00
parent 52a01ca846
commit 04083e39d5

View File

@ -1111,31 +1111,29 @@ class Entreprise extends WsScore
{
$this->authenticate();
$perm = false;
switch($niveau){
case 1:
if ( !$this->checkPerm('indiscore') || !$this->checkPerm('indiscorep') ){
$this->permission('indiscore');
}
break;
case 2:
if (!$this->checkPerm('indiscore2') || !$this->checkPerm('indiscore2p') ){
$this->permission('indiscore2');
}
break;
case 3:
if (!$this->checkPerm('indiscore3') || !$this->checkPerm('indiscore3p') ){
$this->permission('indiscore3');
}
break;
}
//Initialisation
$accesDist = true;
if (empty($nic)) { $nic = 0; }
if (empty($niveau)) { $niveau = 2; }
if (empty($plus)) { $plus = false; }
if ( !in_array($niveau, array(0,1,2,3,4,5)) ) { $niveau = 2; }
if (empty($nic)) { $nic = 0; }
if (empty($niveau)) { $niveau = 2; }
if (empty($plus)) { $plus = false; }
if ( !in_array($niveau, array(0,1,2,3,4,5)) ) { $niveau = 2; }
$perm = false;
switch($niveau){
case 1: $perms = array('indiscore', 'indiscorep'); break;
case 2: $perms = array('indiscore2', 'indiscore2p'); break;
case 3: $perms = array('indiscore3', 'indiscore3p'); break;
}
foreach($perms as $item){
if ( $this->checkPerm($item) ){
$perm = true;
break;
}
}
if ($perm === false) {
$this->sendError('9002');
}
$tabRet = array();
debugLog('I',"IndiScore demandée pour $siren en niveau $niveau",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
if (strlen($siren)>9 || (substr($siren,0,9)*1)<100 ){