Decrement fonctionnel
This commit is contained in:
parent
0dbfe9e7f4
commit
ab91971aa4
@ -9,6 +9,8 @@ class Metier_Credit_Decrement extends Scores_Ws_Server
|
||||
protected $conn;
|
||||
private $session_period=3600;
|
||||
private $sessionvar=array();
|
||||
private $rateType;
|
||||
private $logCost;
|
||||
|
||||
public function __construct($db = null)
|
||||
{
|
||||
@ -37,7 +39,6 @@ class Metier_Credit_Decrement extends Scores_Ws_Server
|
||||
}
|
||||
$canUseResult->typecredit=$this->rateType;
|
||||
return $canUseResult;
|
||||
|
||||
}
|
||||
public function setUsed($idLog,$user){
|
||||
if(!isset($this->rateType)){
|
||||
|
@ -73,6 +73,8 @@ class Scores_Ws_Server
|
||||
'62.210.222.34',
|
||||
);
|
||||
|
||||
protected $idLog = 'unknown';
|
||||
|
||||
/**
|
||||
* Liste des permissions
|
||||
* @var array
|
||||
@ -90,14 +92,14 @@ class Scores_Ws_Server
|
||||
* @var array
|
||||
*/
|
||||
protected $listePrefs = array(
|
||||
'NAF4' => "Afficher les anciens NAF",
|
||||
'NACE' => "Afficher les codes NACES",
|
||||
'NEWS' => "Afficher les news Google©",
|
||||
'MAPPY' => "Afficher les façades d'immeubles",
|
||||
'NAF4' => "Afficher les anciens NAF",
|
||||
'NACE' => "Afficher les codes NACES",
|
||||
'NEWS' => "Afficher les news Google©",
|
||||
'MAPPY' => "Afficher les façades d'immeubles",
|
||||
'CARTES' => "Afficher les cartes et les plans",
|
||||
'VOIRSURV' => "Afficher les entités sous surveillances",
|
||||
'VOIRSURV' => "Afficher les entités sous surveillances",
|
||||
'DEMANDEREF' => "Demande de référence par defaut",
|
||||
'RECHREF' => "Afficher le formulaire de recherche par référence",
|
||||
'RECHREF' => "Afficher le formulaire de recherche par référence",
|
||||
);
|
||||
|
||||
/**
|
||||
@ -301,7 +303,6 @@ class Scores_Ws_Server
|
||||
$siren = $siret;
|
||||
$nic = '';
|
||||
}
|
||||
|
||||
// Set data by default
|
||||
$dataInsert = array(
|
||||
'login' => $this->User->login,
|
||||
@ -381,7 +382,9 @@ class Scores_Ws_Server
|
||||
$this->conn->insert('sdv1.logs', $dataInsert);
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
}
|
||||
}
|
||||
$crdt=new Metier_Credit_Decrement();
|
||||
$ok=$crdt->setUsed($this->idLog,$this->User);
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate with SoapHeader, Optional (Authentication could be done by sending HTTP Basic header - see the doc)
|
||||
@ -452,11 +455,46 @@ class Scores_Ws_Server
|
||||
* Check permission
|
||||
* @param string $perm
|
||||
*/
|
||||
protected function permission($perm)
|
||||
protected function permission($perm,$idLog='')
|
||||
{
|
||||
if (!$this->checkPerm($perm)) {
|
||||
$this->sendError('0902');
|
||||
}
|
||||
if(empty($idLog)){$idLog=$this->getIdLog();}
|
||||
//if(empty($idLog)){$idLog=$this->idLog;;}
|
||||
if(!empty($idLog)){
|
||||
$this->idLog=$idLog;
|
||||
if (!$this->checkCredit($idLog)) {
|
||||
$this->sendError('0902');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user has the money to access payable WebService
|
||||
* @throws SoapFault
|
||||
*/
|
||||
protected function checkCredit($idLog){
|
||||
//$this->idLog=$this->getIdLog();
|
||||
$crdt=new Metier_Credit_Decrement();
|
||||
$ok=$crdt->canUse($idLog,$this->User);
|
||||
return $ok->result;
|
||||
}
|
||||
/**
|
||||
* I keep this one oldie but goodie
|
||||
*
|
||||
*/
|
||||
|
||||
private function getIdLog(){
|
||||
$tab=explode("#",$_SERVER['CONTENT_TYPE']);
|
||||
if(count($tab)>1){
|
||||
$tab=explode('"',$tab);
|
||||
$idLog=$tab[0];
|
||||
}else{
|
||||
$idLog=$this->idLog;
|
||||
}
|
||||
$this->logger->info('idLog :'.$idLog);
|
||||
return $idLog;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,9 +42,10 @@ class Credit extends Scores_Ws_Server
|
||||
*/
|
||||
public function infoCredit()
|
||||
{
|
||||
$service='credit';
|
||||
$info=new infoCredit();
|
||||
$this->authenticate();
|
||||
$this->permission($this->libdroits);
|
||||
$this->permission($this->libdroits,__FUNCTION__);
|
||||
|
||||
$idUser = $this->User->id;
|
||||
if(intval($idUser)==0){
|
||||
@ -70,19 +71,19 @@ class Credit extends Scores_Ws_Server
|
||||
$info->balance=null;
|
||||
}
|
||||
$sql = "SELECT * FROM sdv1.credit__paid c
|
||||
WHERE c.idUser=:idUser limit 100";
|
||||
WHERE c.idUser=:idUser order by id desc limit 20";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('idUser', $idUser);
|
||||
$stmt->execute();
|
||||
$info->paid=$stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$sql = "SELECT * FROM sdv1.credit__consumption c
|
||||
WHERE c.idUser=:idUser limit 100";
|
||||
WHERE c.idUser=:idUser order by id desc limit 20";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('idUser', $idUser);
|
||||
$stmt->execute();
|
||||
$info->used=$stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
|
||||
$this->wsLog('infoCredit', $idUser);
|
||||
$this->wsLog(__FUNCTION__,$siret,$id);
|
||||
return $info;
|
||||
}
|
||||
|
||||
@ -165,7 +166,7 @@ class Credit extends Scores_Ws_Server
|
||||
|
||||
}
|
||||
$PayCreditResult->result=true;
|
||||
$this->wsLog('payCredit', $ir['idCmd']);
|
||||
$this->wsLog(__FUNCTION__, $idUser);
|
||||
return $PayCreditResult;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getIdentite($siret, $id = 0)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('identite');
|
||||
$this->permission('identite', __FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($id)) { $id = 0; }
|
||||
@ -297,7 +297,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getIdentiteProcol($siret, $id=0, $forceVerif=false)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('idprocol');
|
||||
$this->permission('idprocol',__FUNCTION__);
|
||||
|
||||
$this->logger->info("Identité AGS demandée pour siret $siret (id=$id)");
|
||||
|
||||
@ -660,7 +660,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getLiens($siren, $actifsUniquement = true)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('liens');
|
||||
$this->permission('liens',__FUNCTION__);
|
||||
|
||||
// Initialisation
|
||||
if (empty($actifsUniquement)) { $actifsUniquement = true; }
|
||||
@ -739,7 +739,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getListeEtablissements($siren, $dep = 0, $actif = -1, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('etablissements');
|
||||
$this->permission('etablissements',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($dep)) { $dep = 0; }
|
||||
@ -807,7 +807,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getDirigeants( $siren , $histo = false)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('dirigeants');
|
||||
$this->permission('dirigeants',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($histo)) { $histo = false; }
|
||||
@ -864,7 +864,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAnnonces($siren, $filtre = 1, $idAnn = '', $position = 0, $nbRep = 100)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('annonces');
|
||||
$this->permission('annonces',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($filtre)) { $filtre = 1; }
|
||||
@ -1164,7 +1164,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAnnoncesLegales($siren, $idAnn = null, $filtre = null, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('annonces');
|
||||
$this->permission('annonces',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($idAnn)) { $idAnn = null; }
|
||||
@ -1269,7 +1269,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAnnoncesAsso($siren, $idAnn = null, $filtre = null, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('annonces');
|
||||
$this->permission('annonces',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($idAnn)) { $idAnn = 0; }
|
||||
@ -1358,7 +1358,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAnnoncesBoamp($siren, $idAnn = null, $filtre = null, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('annonces');
|
||||
$this->permission('annonces', __FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($idAnn)) { $idAnn = ''; }
|
||||
@ -1458,7 +1458,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAnnoncesBalo($siren, $idAnn = null, $filtre = null, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('annonces');
|
||||
$this->permission('annonces',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($idAnn)) { $idAnn = null; }
|
||||
@ -1561,7 +1561,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
case 1: $perms = array('indiscore', 'indiscorep'); break;
|
||||
}
|
||||
foreach($perms as $item){
|
||||
if ( $this->checkPerm($item) ){
|
||||
if ( $this->checkPerm($item, __FUNCTION__) ){
|
||||
$perm = true;
|
||||
break;
|
||||
}
|
||||
@ -1795,7 +1795,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getValo($siren, $nic=0, $niveau=2)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('indiscore');
|
||||
$this->permission('indiscore',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
$accesDist = true;
|
||||
@ -2045,7 +2045,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getListeEvenements($siren, $nic=0, $position=0, $nbRep=1000)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('eveninsee');
|
||||
$this->permission('eveninsee',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($nic)) { $nic = 0; }
|
||||
@ -2767,7 +2767,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getInfosReg( $siren, $id = false )
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('infosreg');
|
||||
$this->permission('infosreg',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($id)) $id = false;
|
||||
@ -2832,7 +2832,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getInfosBourse($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('bourse');
|
||||
$this->permission('bourse', __FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
$error = new ErrorType();
|
||||
@ -2917,32 +2917,32 @@ class Entreprise extends Scores_Ws_Server
|
||||
$source = strtolower($source);
|
||||
switch ($source) {
|
||||
case 'insee':
|
||||
$this->permission('survinsee');
|
||||
$this->permission('survinsee',__FUNCTION__);
|
||||
break;
|
||||
case 'bilans':
|
||||
$this->permission('survbilan');
|
||||
$this->permission('survbilan',__FUNCTION__);
|
||||
break;
|
||||
case 'actes':
|
||||
$this->permission('survactes');
|
||||
$this->permission('survactes',__FUNCTION__);
|
||||
break;
|
||||
case 'privileges':
|
||||
$this->permission('survpriv');
|
||||
$this->permission('survpriv',__FUNCTION__);
|
||||
break;
|
||||
case 'dirigeants':
|
||||
$this->permission('survdirigeants');
|
||||
$this->permission('survdirigeants',__FUNCTION__);
|
||||
break;
|
||||
case 'score':
|
||||
$this->permission('survscore');
|
||||
$this->permission('survscore',__FUNCTION__);
|
||||
break;
|
||||
case 'paiements':
|
||||
$this->permission('survpaiements');
|
||||
$this->permission('survpaiements',__FUNCTION__);
|
||||
break;
|
||||
case 'liens':
|
||||
$this->permission('survliens');
|
||||
$this->permission('survliens',__FUNCTION__);
|
||||
break;
|
||||
case 'annonces':
|
||||
default:
|
||||
$this->permission('survannonce');
|
||||
$this->permission('survannonce',__FUNCTION__);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3032,7 +3032,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getSurveillances($filtre, $position=0, $nbRep=100)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('survliste');
|
||||
$this->permission('survliste',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($position)) $position = 0;
|
||||
@ -3307,7 +3307,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getBilan($siren, $millesime, $typeBilan='N', $ref='')
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('liasse');
|
||||
$this->permission('liasse',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($typeBilan)) { $typeBilan = 'N'; }
|
||||
@ -3358,7 +3358,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getListeBilans($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('liasse');
|
||||
$this->permission('liasse',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
$tabRet = array();
|
||||
@ -3443,7 +3443,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function rechercheAnnonce($source, $dateAnnee, $numParution, $numAnnonce)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('histobodacc');
|
||||
$this->permission('histobodacc',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
$tabRet = array();
|
||||
@ -3529,7 +3529,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getRatios($siren, $page='ratios')
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('ratios');
|
||||
$this->permission('ratios',__FUNCTION__);
|
||||
|
||||
global $tva, $tabFormules, $mBil, $tabBilan, $efftr, $tabInfla;
|
||||
$tabFormules = include APPLICATION_PATH . '/../library/Metier/Scores/Data/TabFormules.php';
|
||||
@ -3759,7 +3759,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
case 3: $perms = array('indiscore3', 'indiscore3p'); break;
|
||||
}
|
||||
foreach($perms as $item){
|
||||
if ( $this->checkPerm($item) ){
|
||||
if ( $this->checkPerm($item,__FUNCTION__) ){
|
||||
$perm = true;
|
||||
break;
|
||||
}
|
||||
@ -3797,7 +3797,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getBanques($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
|
||||
$this->permission('searchent',__FUNCTION__);
|
||||
//Initialisation
|
||||
$iDb = new Metier_Util_Db();
|
||||
$tabRet = array();
|
||||
@ -3874,7 +3874,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getListeCompetences($siret, $type, $codeInsee)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('competences');
|
||||
$this->permission('competences',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
$error = new ErrorType();
|
||||
|
@ -12,7 +12,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getIdentite($siret, $id = 0)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('identite');
|
||||
$this->permission('identite',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($id)) { $id = 0; }
|
||||
@ -470,7 +470,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getIdentiteProcol($siret, $id=0, $forceVerif=false)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('idprocol');
|
||||
$this->permission('idprocol',__FUNCTION__);
|
||||
|
||||
$this->logger->info("Identité AGS demandée pour siret $siret (id=$id)");
|
||||
|
||||
@ -826,7 +826,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getLiens($siren, $type = null)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('liens');
|
||||
$this->permission('liens',__FUNCTION__);
|
||||
|
||||
//Load country table
|
||||
try {
|
||||
@ -1260,7 +1260,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getLienRef($id)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('liens');
|
||||
$this->permission('liens',__FUNCTION__);
|
||||
|
||||
$refM = new Application_Model_JoLiensRef();
|
||||
|
||||
@ -1359,7 +1359,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getListeEtablissements($siren, $dep = 0, $actif = -1, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('etablissements');
|
||||
$this->permission('etablissements',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($dep)) { $dep = 0; }
|
||||
@ -1424,7 +1424,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getDirigeants( $siren , $histo = false)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('dirigeants');
|
||||
$this->permission('dirigeants',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($histo)) { $histo = false; }
|
||||
@ -1785,7 +1785,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAnnoncesLegales($siren, $idAnn = null, $filtre = null, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('annonces');
|
||||
$this->permission('annonces',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($idAnn)) { $idAnn = null; }
|
||||
@ -1911,7 +1911,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAnnoncesAsso($siren, $idAnn = null, $filtre = null, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('annonces');
|
||||
$this->permission('annonces', __FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($idAnn)) { $idAnn = 0; }
|
||||
@ -2006,7 +2006,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAnnoncesBoamp($siren, $idAnn = null, $filtre = null, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('annonces');
|
||||
$this->permission('annonces',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($idAnn)) { $idAnn = ''; }
|
||||
@ -2139,7 +2139,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAnnoncesBalo($siren, $idAnn = null, $filtre = null, $position = 0, $nbRep = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('annonces');
|
||||
$this->permission('annonces', __FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($idAnn)) { $idAnn = null; }
|
||||
@ -2243,7 +2243,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
case 1: $perms = array('indiscore', 'indiscorep'); break;
|
||||
}
|
||||
foreach($perms as $item){
|
||||
if ( $this->checkPerm($item) ){
|
||||
if ( $this->checkPerm($item, __FUNCTION__) ){
|
||||
$perm = true;
|
||||
break;
|
||||
}
|
||||
@ -2911,7 +2911,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getListeEvenements($siren, $nic=0, $position=0, $nbRep=50)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('eveninsee');
|
||||
$this->permission('eveninsee',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($nic)) { $nic = 0; }
|
||||
@ -3655,7 +3655,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getInfosReg( $siren, $id = null )
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('infosreg');
|
||||
$this->permission('infosreg',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($id)) $id = null;
|
||||
@ -3718,7 +3718,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getInfosBourse($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('bourse');
|
||||
$this->permission('bourse', __FUNCTION__ );
|
||||
|
||||
//Initialisation
|
||||
$error = new ErrorType();
|
||||
@ -4299,7 +4299,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getListeBilans($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('liasse');
|
||||
$this->permission('liasse',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
$tabRet = array();
|
||||
@ -4571,7 +4571,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getRatios($siren, $page='ratios')
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('ratios');
|
||||
$this->permission('ratios',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($page)) $page = 'ratios';
|
||||
@ -4858,7 +4858,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
case 3: $perms = array('indiscore3', 'indiscore3p'); break;
|
||||
}
|
||||
foreach($perms as $item){
|
||||
if ( $this->checkPerm($item) ){
|
||||
if ( $this->checkPerm($item, __FUNCTION__) ){
|
||||
$perm = true;
|
||||
break;
|
||||
}
|
||||
@ -4896,7 +4896,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getBanques($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('banque');
|
||||
$this->permission('banque',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
$iDb = new Metier_Util_Db();
|
||||
@ -4972,7 +4972,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getListeCompetences($siret, $type, $codeInsee)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('competences');
|
||||
$this->permission('competences',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
$error = new ErrorType();
|
||||
@ -5289,7 +5289,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getSubventionList($companyId, $type = null, $offset = 0, $nbItems = 100)
|
||||
{
|
||||
$this->authenticate();
|
||||
|
||||
$this->permission('identite',__FUNCTION__);
|
||||
//Init
|
||||
if ( intval($companyId) == 0 ) {
|
||||
$this->sendError('1010');
|
||||
|
@ -12,7 +12,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getIdentite($siret, $id = 0)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('identite');
|
||||
$this->permission('identite',__FUNCTION__);
|
||||
|
||||
//Initialisation
|
||||
if (empty($id)) { $id = 0; }
|
||||
@ -348,7 +348,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getAvisRncs($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('avisrncs');
|
||||
$this->permission('avisrncs',__FUNCTION__);
|
||||
|
||||
$len = strlen($siren);
|
||||
if ( $len != 9 ) {
|
||||
@ -540,7 +540,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getRNVP($companyId, $type = null)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('RNVP');
|
||||
$this->permission('RNVP',__FUNCTION__);
|
||||
|
||||
// --- Identifiant SD : source + id
|
||||
if ($type === null) {
|
||||
@ -820,7 +820,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getGreffeAffaireList($companyId, $tiers = 'DE', $p = 0, $limit = 20)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('contentieux');
|
||||
$this->permission('contentieux', __FUNCTION__);
|
||||
|
||||
if ( strlen($companyId) != 9 ) {
|
||||
throw new SoapFault('ERR', 'Identifiant incorrect.');
|
||||
@ -932,7 +932,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
public function getGreffeAffaireDetail($id)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('contentieux');
|
||||
$this->permission('contentieux', __FUNCTION__);
|
||||
|
||||
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
|
||||
|
||||
@ -1252,7 +1252,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
protected function getIndiScore($companyId)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('INDISCORE');
|
||||
$this->permission('INDISCORE',__FUNCTION__);
|
||||
/*
|
||||
Evaluation indiscore d'une entreprise
|
||||
Ne pas renvoyer les commentaires tabCommentaires
|
||||
@ -1275,7 +1275,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
protected function getReportSynthese($companyId)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('INDISCORE2');
|
||||
$this->permission('INDISCORE2',__FUNCTION__);
|
||||
|
||||
$siren = substr($companyId, 0, 9);
|
||||
if (intval($siren) < 100 ) {
|
||||
@ -1299,7 +1299,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
{
|
||||
$this->authenticate();
|
||||
|
||||
$this->permission('INDISCORE3');
|
||||
$this->permission('INDISCORE3',__FUNCTION__);
|
||||
|
||||
$reportStruct = new Report();
|
||||
|
||||
|
@ -300,7 +300,7 @@ class Interne extends Scores_Ws_Server
|
||||
public function getListeConventions($siren)
|
||||
{
|
||||
$this->authenticate();
|
||||
|
||||
$this->permission('identite',__FUNCTION__);
|
||||
//Initialisation
|
||||
$error = new ErrorType();
|
||||
$tabRet = array();
|
||||
@ -554,7 +554,7 @@ class Interne extends Scores_Ws_Server
|
||||
public function getMarques($siren, $idDepot=0)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('marques');
|
||||
$this->permission('marques',__FUNCTION__);
|
||||
$this->logger->info("Liste des marques déposées pour le siren $siren");
|
||||
|
||||
if (empty($idDepot)) $idDepot = 0;
|
||||
|
@ -18,7 +18,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function getKbis($siren, $diffusion = 'T', $reference = '')
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('KBIS');
|
||||
$this->permission('KBIS',__FUNCTION__);
|
||||
|
||||
$siren = substr($siren, 0, 9);
|
||||
|
||||
@ -61,7 +61,6 @@ class Pieces extends Scores_Ws_Server
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
|
||||
switch ($diffusion) {
|
||||
|
||||
// Demande de KBIS par email
|
||||
@ -179,7 +178,7 @@ class Pieces extends Scores_Ws_Server
|
||||
// @todo : Code Saisie + Date saisie
|
||||
|
||||
$this->authenticate();
|
||||
|
||||
$this->checkCredit(__FUNCTION__);
|
||||
if (empty($position)) {
|
||||
$position = 0;
|
||||
}
|
||||
@ -368,7 +367,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function getBilan($identifiant, $dateCloture, $type, $diffusion, $reference = '')
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('actes');
|
||||
$this->permission('actes',__FUNCTION__);
|
||||
|
||||
if (strlen($identifiant) != 9) {
|
||||
$this->sendError('1010');
|
||||
@ -552,6 +551,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function getActes($identifiant, $position = 0, $nbRep = 200)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->checkCredit(__FUNCTION__);
|
||||
|
||||
if ( empty($position) ) {
|
||||
$position = 0;
|
||||
@ -622,7 +622,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function getActe($identifiant, $diffusion, $depotNum, $depotDate, $acteType, $acteNum, $acteDate, $reference = '')
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('actes');
|
||||
$this->permission('actes', __FUNCTION__);
|
||||
|
||||
if (strlen($identifiant) != 9) {
|
||||
$this->sendError('1010');
|
||||
@ -767,7 +767,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function setActeCmdEmail($id, $email)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('actes');
|
||||
$this->permission('actes', __FUNCTION__);
|
||||
|
||||
$validator = new Zend_Validate_EmailAddress();
|
||||
if ( !$validator->isValid($email) ){
|
||||
@ -828,7 +828,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function setBilanCmdEmail($id, $email)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('actes');
|
||||
$this->permission('actes', __FUNCTION__);
|
||||
|
||||
$validator = new Zend_Validate_EmailAddress();
|
||||
if ( !$validator->isValid($email) ){
|
||||
@ -889,7 +889,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function setKbisCmdEmail($id, $email)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('KBIS');
|
||||
$this->permission('KBIS', __FUNCTION__);
|
||||
|
||||
$validator = new Zend_Validate_EmailAddress();
|
||||
if ( !$validator->isValid($email) ){
|
||||
@ -952,7 +952,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function setKbisCmdLetter($id, $infos)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('KBIS');
|
||||
$this->permission('KBIS', __FUNCTION__);
|
||||
|
||||
// --- Vérification que la commande existe
|
||||
try {
|
||||
@ -1004,6 +1004,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function getAssoActes($companyId, $type = null)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->checkCredit(__FUNCTION__);
|
||||
|
||||
// --- Lecture de la table des actes associations
|
||||
try {
|
||||
@ -1050,7 +1051,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function getAssoActe($companyId, $type = null, $date)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('actes');
|
||||
$this->permission('actes',__FUNCTION__);
|
||||
|
||||
// --- Lecture table des actes associations
|
||||
try {
|
||||
@ -1106,7 +1107,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function setAssoStatut($companyId, $type = null)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('actes');
|
||||
$this->permission('actes',__FUNCTION__);
|
||||
|
||||
$inseeM = new Metier_Insee_MInsee();
|
||||
if ($type == 'siren') {
|
||||
@ -1158,7 +1159,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function setAssoStatutDetail($id, $data)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('actes');
|
||||
$this->permission('actes',__FUNCTION__);
|
||||
|
||||
// --- Vérification que la commande existe
|
||||
try {
|
||||
@ -1235,7 +1236,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function setPrivileges($companyId, $doc = null)
|
||||
{
|
||||
$this->authenticate();
|
||||
$this->permission('privileges');
|
||||
$this->permission('privileges',__FUNCTION__);
|
||||
|
||||
$inseeM = new Metier_Insee_MInsee();
|
||||
$result = $inseeM->getIdentiteLight($companyId);
|
||||
@ -1280,7 +1281,7 @@ class Pieces extends Scores_Ws_Server
|
||||
public function setPrivilegesEmail($id, $email)
|
||||
{
|
||||
$this->authenticate();
|
||||
|
||||
$this->checkCredit(__FUNCTION__);
|
||||
$validator = new Zend_Validate_EmailAddress();
|
||||
if ( !$validator->isValid($email) ){
|
||||
throw new SoapFault('ERR', "Adresse email invalide.");
|
||||
|
Loading…
Reference in New Issue
Block a user