Réintégration de certaines erreurs
This commit is contained in:
parent
572e927f5a
commit
2fc5c1900c
@ -740,4 +740,8 @@ return array(
|
||||
'000Z' => "00Z",
|
||||
'526D' => "526D",
|
||||
'8121' => "8121",
|
||||
'7904' => "7904",
|
||||
'745A' => "745A",
|
||||
'702A' => "702A",
|
||||
'702C' => "702C",
|
||||
);
|
||||
|
@ -1484,4 +1484,8 @@ return array(
|
||||
'000Z' => "",
|
||||
'526D' => "",
|
||||
'8121' => "",
|
||||
'7904' => "",
|
||||
'745A' => "",
|
||||
'702A' => "",
|
||||
'702C' => "",
|
||||
);
|
||||
|
@ -4690,7 +4690,7 @@ class MInsee
|
||||
if ($idAnnonce != 0) {
|
||||
// --- Annonce
|
||||
if (substr($idAnnonce,0,2) == '0.') {
|
||||
$idAnnonce == substr($idAnnonce,2);
|
||||
$idAnnonce = substr($idAnnonce,2);
|
||||
$sqlAnnonceWhere = "a.id=$idAnnonce";
|
||||
$sqlAnnonceWhere.= " AND a.tribunal=t.triCode AND a.dateSuppr=0";
|
||||
$sqlAnnonceWhere.= " GROUP BY a.siren, a.dateJugement, a.typeEven ORDER BY a.dateJugement DESC";
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?
|
||||
<?php
|
||||
require_once 'framework/common/curl.php';
|
||||
|
||||
class MBilans {
|
||||
|
||||
class MBilans
|
||||
{
|
||||
private $body = '';
|
||||
private $header = '';
|
||||
private $codeRetour = 0;
|
||||
|
@ -64,7 +64,7 @@ class Scores_Ws_Server
|
||||
'91.121.157.194', //Extranet - ns359466
|
||||
'78.31.45.206', //SDSL RAMBOUILLET
|
||||
'127.0.0.1',
|
||||
'192.168.33.1',
|
||||
'192.168.33.10',
|
||||
);
|
||||
|
||||
protected $listProxyIp = array(
|
||||
@ -765,16 +765,19 @@ class Scores_Ws_Server
|
||||
|
||||
} elseif ($ip != '127.0.0.1') {
|
||||
|
||||
// For customized version, check user is in the good service
|
||||
// --- For customized version, check user is in the good service
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
$wsClients = array();
|
||||
foreach( $clients as $section => $params ){
|
||||
if ($params['actif']) {
|
||||
$wsClients[$params['idClient']] = $section;
|
||||
if (count($params['idClient']) > 0) {
|
||||
foreach ($params['idClient'] as $idClient) {
|
||||
$wsClients[$idClient] = $section;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( array_key_exists($userInfos->idClient, $wsClients)
|
||||
&& ( $this->serviceClient === false
|
||||
if ( array_key_exists($userInfos->idClient, $wsClients) && ( $this->serviceClient === false
|
||||
|| strtolower($this->serviceClientName) != $wsClients[$userInfos->idClient] ) ){
|
||||
return '0901';
|
||||
}
|
||||
@ -797,44 +800,50 @@ class Scores_Ws_Server
|
||||
* Get an array of IP and IP range
|
||||
* 192.168.3.5-192.68.3.10;192.168.3.*;192.168.3.10
|
||||
*/
|
||||
if ( !empty($userInfos->filtre_ip) && !in_array($ip, $this->listApplicationIp) ) {
|
||||
$filtreIp = explode(';', trim($userInfos->filtre_ip, ';'));
|
||||
if ( count($filtreIp)>0 ) {
|
||||
// Extranet
|
||||
if ( substr($password,0,7)=='iponly:' ) {
|
||||
$ipToValidate = substr($password,7);
|
||||
}
|
||||
// WebService
|
||||
else {
|
||||
$ipToValidate = $ip;
|
||||
}
|
||||
//Validation
|
||||
$overallIpValidate = false;
|
||||
foreach ( $filtreIp as $filtre ) {
|
||||
if ( strpos($filtre, '*') ) {
|
||||
$filtre = str_replace('*', '0', $filtre) . '-' . str_replace('*', '255', $filtre);
|
||||
|
||||
if ( !in_array($ip, $this->listApplicationIp) ) {
|
||||
if ( !empty($userInfos->filtre_ip) ) {
|
||||
$filtreIp = explode(';', trim($userInfos->filtre_ip, ';'));
|
||||
if ( count($filtreIp)>0 ) {
|
||||
|
||||
// Extranet
|
||||
if ( substr($password,0,7)=='iponly:' ) {
|
||||
$ipToValidate = substr($password,7);
|
||||
}
|
||||
// Is it a range ?
|
||||
if ( strpos($filtre, '-') ) {
|
||||
$validateIp = new Scores_Validate_IpInNetwork();
|
||||
$validateIp->setNetworkNotation($filtre);
|
||||
$overallIpValidate = $validateIp->isValid($ipToValidate);
|
||||
}
|
||||
// Ip only
|
||||
// WebService
|
||||
else {
|
||||
if ( $filtre === $ipToValidate ) {
|
||||
$overallIpValidate = true;
|
||||
$ipToValidate = $ip;
|
||||
}
|
||||
|
||||
//Validation
|
||||
$overallIpValidate = false;
|
||||
foreach ( $filtreIp as $filtre ) {
|
||||
if ( strpos($filtre, '*') ) {
|
||||
$filtre = str_replace('*', '0', $filtre) . '-' . str_replace('*', '255', $filtre);
|
||||
}
|
||||
// Is it a range ?
|
||||
if ( strpos($filtre, '-') ) {
|
||||
$validateIp = new Scores_Validate_IpInNetwork();
|
||||
$validateIp->setNetworkNotation($filtre);
|
||||
$overallIpValidate = $validateIp->isValid($ipToValidate);
|
||||
}
|
||||
// Ip only
|
||||
else {
|
||||
if ( $filtre === $ipToValidate ) {
|
||||
$overallIpValidate = true;
|
||||
}
|
||||
}
|
||||
// Break foreach
|
||||
if ( $overallIpValidate === true ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Break foreach
|
||||
if ( $overallIpValidate === true ) {
|
||||
break;
|
||||
|
||||
// Exit with error
|
||||
if ( $overallIpValidate === false ) {
|
||||
return '0904';
|
||||
}
|
||||
}
|
||||
// Exit with error
|
||||
if ( $overallIpValidate === false ) {
|
||||
return '0904';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,6 +110,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
}
|
||||
|
||||
$inseeM = new MInsee();
|
||||
$inseeM->AnnoncesLegalesVisu = true;
|
||||
$tabProcol = $inseeM->getAnnoncesLegales($siren, 0, 'P', false);
|
||||
if ( count($tabProcol)>0 ) {
|
||||
$modelIdentite->JugementDate = $tabProcol[0]['dateJugement'];
|
||||
|
@ -64,14 +64,17 @@ class Entreprise extends Scores_Ws_Server
|
||||
$DateCreaEn = $evaluation['DateCreaEt'];
|
||||
} elseif ( $evaluation['DateCreaEn'] > 0 ) {
|
||||
$DateCreaEn = $evaluation['DateCreaEn'];
|
||||
}
|
||||
if ( !empty($DateCreaEn) ) {
|
||||
if (substr($DateCreaEn, -2) * 1 == 0) {
|
||||
$Infos->DateCreaEn = substr($DateCreaEn,0,6).'01';
|
||||
} else {
|
||||
$Infos->DateCreaEn = $DateCreaEn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Correction pour l'envoi des dates
|
||||
if ( !empty($DateCreaEn) ) {
|
||||
if (strlen($DateCreaEn)<8) {
|
||||
$DateCreaEn = str_pad($DateCreaEn, 8, '0', STR_PAD_RIGHT);
|
||||
}
|
||||
if (substr($DateCreaEn, -2) * 1 == 0) {
|
||||
$DateCreaEn = substr($DateCreaEn,0,6).'01';
|
||||
}
|
||||
}
|
||||
|
||||
$Infos->AdresseNum = str_pad($evaluation['AdresseNum'], 5, 0, STR_PAD_LEFT);
|
||||
$Infos->AdresseBtq = $evaluation['AdresseBtq'];
|
||||
|
@ -1313,7 +1313,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
|
||||
$output->capital = new stdClass();
|
||||
$output->capital->amount = $result['capital'];
|
||||
$output->capital->currency = $result['devCapital'];
|
||||
$output->capital->currency = $result['deviseCapital'];
|
||||
|
||||
//@todo : Utiliser le libellé du pays
|
||||
$output->adressePays = $result['adresse_pays'];
|
||||
@ -1762,9 +1762,11 @@ class Entreprise extends Scores_Ws_Server
|
||||
} elseif (intval($siren)!=0) {
|
||||
$types = array('bodacc', 'balo', 'boamp', 'asso');
|
||||
$iInsee = new MInsee();
|
||||
$iInsee->AnnoncesLegalesVisu = true;
|
||||
foreach ($types as $type) {
|
||||
switch($type) {
|
||||
case 'bodacc':
|
||||
//@ todo : Get count
|
||||
$anns = $iInsee->getAnnoncesLegales($siren);
|
||||
$total = count($anns);
|
||||
break;
|
||||
@ -1820,6 +1822,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
}
|
||||
|
||||
$iInsee = new MInsee();
|
||||
$iInsee->AnnoncesLegalesVisu = true;
|
||||
|
||||
$isList = false;
|
||||
|
||||
@ -1835,27 +1838,29 @@ class Entreprise extends Scores_Ws_Server
|
||||
$liste = array();
|
||||
$cpt = 0;
|
||||
|
||||
if (is_array($anns))
|
||||
{
|
||||
if ( is_array($anns) && $nbReponses > 0 ) {
|
||||
foreach ($anns as $nb => $ann) {
|
||||
if ($isList===true && $nb<$position) { continue; }
|
||||
$cpt++;
|
||||
if ($isList===true && $cpt>$nbRep) { break; }
|
||||
|
||||
//@todo : Entites
|
||||
/**
|
||||
* Si l'annonce est une annonce BODACC alors
|
||||
* recherche des entités concernées
|
||||
*/
|
||||
$entites = array();
|
||||
if (in_array($ann['BodaccCode'], array('BODA', 'BODB', 'BODC'))) {
|
||||
$detailM = new Application_Model_JoBodaccDetail();
|
||||
$sql = $detailM->select()->from($detailM, array(
|
||||
'LPAD(siren, 9, 000000000) AS siren',
|
||||
'LPAD(nic, 5, 00000) AS nic',
|
||||
'LPAD(siren, 9, 0) AS siren',
|
||||
'LPAD(nic, 5, 0) AS nic',
|
||||
'raisonSociale','adresse', 'codePostal', 'ville', 'typeEven')
|
||||
)->where('id=?', $ann['id']);
|
||||
$result = $detailM->fetchAll($sql);
|
||||
if (count($result)>1) {
|
||||
foreach ($result as $entity) {
|
||||
$entite = new AnnonceEntite();
|
||||
$entite->siret = $entity->siren.$entity->nic;
|
||||
$entite->siret = $entity->siren . $entity->nic;
|
||||
$entite->raisonSociale = $entity->raisonSociale;
|
||||
|
||||
$iBodacc = new MBodacc();
|
||||
@ -4289,7 +4294,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
//Initialisation
|
||||
$tabRet = array();
|
||||
debugLog('I',"Liste des Bilans demandée pour $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
if (strlen($siren)<>9) {
|
||||
if (strlen($siren)!=9) {
|
||||
debugLog('W', "Siren $siren incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('1010');
|
||||
} elseif ($siren*1==0) {
|
||||
@ -4299,8 +4304,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
|
||||
$mBil = new MBilans($siren);
|
||||
$tabBilans = $mBil->listeBilans(true);
|
||||
foreach($tabBilans as $bilan)
|
||||
{
|
||||
foreach($tabBilans as $bilan) {
|
||||
$element = new ListeBilans();
|
||||
$element->dateProvPartenaire = $bilan['dateProvPartenaire']; //@todo : date
|
||||
$element->dateInsert = $bilan['dateInsert']; //@todo : date
|
||||
@ -4667,7 +4671,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
|
||||
// RatiosEntrep
|
||||
$ratiosEntrep = new Ratios();
|
||||
if (substr($Rmont,0,1)=='N' || substr($Rmont,0,1)=='<' || substr($Rmont,0,1)=='>'){
|
||||
if (substr($Rmont,0,1)=='N' || substr($Rmont,0,1)=='<' || substr($Rmont,0,1)=='>') {
|
||||
$ratiosEntrep->id = 'r'.$Ridx;
|
||||
$ratiosEntrep->val = $Rmont;
|
||||
} else {
|
||||
@ -4677,18 +4681,26 @@ class Entreprise extends Scores_Ws_Server
|
||||
$tabRatiosEntrep[] = $ratiosEntrep;
|
||||
|
||||
if ( ( $tabBilan[$i]['CONSOLIDE']=='S' && isset($tabRatios[$i+1]) && ($tabBilan[$i+1]['CONSOLIDE']=='S'
|
||||
|| ($tabBilan[$i+1]['CONSOLIDE']=='N' && $tabBilan[$i+1]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE']) ) )
|
||||
|| ( $tabBilan[$i]['CONSOLIDE']=='N'&&isset($tabRatios[$i+1])&&($tabBilan[$i+1]['CONSOLIDE']=='N'
|
||||
|| ($tabBilan[$i+1]['CONSOLIDE']=='S'&&$tabBilan[$i+1]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])) )
|
||||
|| ($tabBilan[$i+1]['CONSOLIDE']=='N' && $tabBilan[$i+1]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])) )
|
||||
|| ( $tabBilan[$i]['CONSOLIDE']=='N' && isset($tabRatios[$i+1]) && ($tabBilan[$i+1]['CONSOLIDE']=='N'
|
||||
|| ($tabBilan[$i+1]['CONSOLIDE']=='S'&& $tabBilan[$i+1]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])) )
|
||||
) {
|
||||
$Rmont=(($R[$Ridx]-$tabRatios[$i+1][$Ridx])*100)/abs($tabRatios[$i+1][$Ridx]);
|
||||
if ($tabRatios[$i+1][$Ridx] == 0) {
|
||||
$Rmont = 'NS';
|
||||
} else {
|
||||
$Rmont = (($R[$Ridx]-$tabRatios[$i+1][$Ridx])*100)/abs($tabRatios[$i+1][$Ridx]);
|
||||
}
|
||||
}
|
||||
elseif ( ( $tabBilan[$i]['CONSOLIDE']=='S' && isset($tabRatios[$i+1]) && ($tabBilan[$i+2]['CONSOLIDE']=='S'
|
||||
|| ($tabBilan[$i+2]['CONSOLIDE']=='N' && $tabBilan[$i+2]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])) )
|
||||
|| ( $tabBilan[$i]['CONSOLIDE']=='N' && isset($tabRatios[$i+1]) && ($tabBilan[$i+2]['CONSOLIDE']=='N'
|
||||
|| ($tabBilan[$i+2]['CONSOLIDE']=='S'&& $tabBilan[$i+2]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])) )
|
||||
) {
|
||||
$Rmont = (($R[$Ridx]-$tabRatios[$i+2][$Ridx])*100)/abs($tabRatios[$i+2][$Ridx]);
|
||||
if ($tabRatios[$i+2][$Ridx] == 0) {
|
||||
$Rmont = 'NS';
|
||||
} else {
|
||||
$Rmont = (($R[$Ridx]-$tabRatios[$i+2][$Ridx])*100)/abs($tabRatios[$i+2][$Ridx]);
|
||||
}
|
||||
} else {
|
||||
$Rmont = 'NS';
|
||||
}
|
||||
|
@ -20,182 +20,187 @@ class Gestion extends Scores_Ws_Server
|
||||
* Récupère les informations du profil connecté
|
||||
* @param string $login
|
||||
* @param string $ipUtilisateur
|
||||
* @param string $from
|
||||
* @return InfosLoginReturn
|
||||
*/
|
||||
public function getInfosLogin($login, $ipUtilisateur = '')
|
||||
public function getInfosLogin($login, $ipUtilisateur = '', $from = null)
|
||||
{
|
||||
//Get User Ip
|
||||
// --- Get User Ip
|
||||
if (empty($ipUtilisateur)) {
|
||||
$ipUtilisateur = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$this->authIp = $ipUtilisateur;
|
||||
|
||||
//Authenticate
|
||||
// --- Authenticate
|
||||
$this->authenticate();
|
||||
|
||||
$error = new ErrorType();
|
||||
$result = new InfosLogin();
|
||||
// --- Profil administrateur
|
||||
$isAdmin = false;
|
||||
if ( in_array($this->User->profil, array('Administrateur', 'SuperAdministrateur')) ) {
|
||||
$isAdmin = true;
|
||||
}
|
||||
|
||||
//Filtre IP
|
||||
$filtre = trim($this->User->filtre_ip);
|
||||
if ( !empty($filtre) && !checkPlagesIp($filtre, $ipUtilisateur) && APPLICATION_ENV!='development' ){
|
||||
debugLog('I',"getInfosLogin Adresse IP $ipUtilisateur non declaree pour le compte $login",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->sendError('0904');
|
||||
}
|
||||
// --- Consultation des infos d'un login
|
||||
$isOtherUser = false;
|
||||
if ( !empty($login) && !in_array($login, array($this->User->login, $this->User->email)) ) {
|
||||
$isOtherUser = true;
|
||||
}
|
||||
|
||||
debugLog('I',"getInfosLogin pour $login (IP=$ipUtilisateur)",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$error = new ErrorType();
|
||||
$result = new InfosLogin();
|
||||
|
||||
//L'utilisateur qui demande les informations est différent
|
||||
if ($this->User->login!=$login && in_array($this->User->profil, array('Administrateur', 'SuperAdministrateur')))
|
||||
{
|
||||
/** Un administrateur veut il des infos sur un login ? **/
|
||||
$iDbCrm = new WDB();
|
||||
$rep = $iDbCrm->select(
|
||||
'sdv1.utilisateurs u, sdv1.clients c',
|
||||
'u.login, u.id, u.email, u.password, u.idClient, u.typeCompte, u.actif, u.filtre_ip, u.civilite, u.nom, u.prenom, u.tel, u.fax, u.mobile, u.profil, u.raisonSociale, u.siret, u.adrNum, u.adrIndRep, u.adrTypeVoie, u.adrLibVoie, u.adrCp, u.adrVille, u.adrComp, u.pref, u.profil, u.dateInscription, u.dateValidation, u.nombreConnexions, u.dateDerniereConnexion, u.droits, u.referenceParDefaut, u.nbReponses, u.lang, u.formatMail, u.dateDebutCompte, u.dateFinCompte, u.maxFicheId, c.droits AS droitsClients, c.test AS clientTest, c.timeout, c.typeScore AS typeScore',
|
||||
"u.login='$login' AND u.idClient=c.id AND u.deleted=0",
|
||||
false, MYSQL_ASSOC
|
||||
);
|
||||
$tabRep = $rep[0];
|
||||
if (count($rep)>0)
|
||||
{
|
||||
$timeOutSec = $tabRep['timeout'];
|
||||
if ($timeOutSec==0) $timeOutSec = 1800;
|
||||
$result->login = $login;
|
||||
$result->id = $tabRep['id'];
|
||||
$result->email = $tabRep['email'];
|
||||
$result->typeCompte = $tabRep['typeCompte'];
|
||||
$result->idClient = $tabRep['idClient'];
|
||||
$result->filtre_ip = $tabRep['filtre_ip'];
|
||||
$result->civilite = $tabRep['civilite'];
|
||||
$result->nom = $tabRep['nom'];
|
||||
$result->prenom = $tabRep['prenom'];
|
||||
$result->raisonSociale = $tabRep['raisonSociale'];
|
||||
$result->siret = $tabRep['siret'];
|
||||
$result->adrNum = $tabRep['adrNum'];
|
||||
$result->adrIndRep = $tabRep['adrIndRep'];
|
||||
$result->adrTypeVoie = $tabRep['adrTypeVoie'];
|
||||
$result->adrLibVoie = $tabRep['adrLibVoie'];
|
||||
$result->adrCp = $tabRep['adrCp'];
|
||||
$result->adrVille = $tabRep['adrVille'];
|
||||
$result->adrComp = $tabRep['adrComp'];
|
||||
$result->tel = $tabRep['tel'];
|
||||
$result->fax = $tabRep['fax'];
|
||||
$result->mobile = $tabRep['mobile'];
|
||||
$result->pref = $tabRep['pref'];
|
||||
$result->profil = $tabRep['profil'];
|
||||
$result->dateInscription = $tabRep['dateInscription'];
|
||||
$result->dateValidation = $tabRep['dateValidation'];
|
||||
$result->nombreConnexions = $tabRep['nombreConnexions'];
|
||||
$result->dateDerniereConnexion = $tabRep['dateDerniereConnexion'];
|
||||
$result->droits = $tabRep['droits'];
|
||||
$result->droitsClients = $tabRep['droitsClients'];
|
||||
$result->timeout = $timeOutSec;
|
||||
$result->clientTest = $tabRep['clientTest'];
|
||||
$result->typeScore = $tabRep['typeScore'];
|
||||
$result->nbReponses = $tabRep['nbReponses'];
|
||||
$result->lang = $tabRep['lang'];
|
||||
$result->formatMail = $tabRep['formatMail'];
|
||||
$result->reference = $tabRep['referenceParDefaut'];
|
||||
$result->dateDebutCompte = $tabRep['dateDebutCompte'];
|
||||
$result->dateFinCompte = $tabRep['dateFinCompte'];
|
||||
$result->maxFicheId = $tabRep['maxFicheId'];
|
||||
} else {
|
||||
/** On log l'erreur d'authentification **/
|
||||
$tabInsert = array(
|
||||
'login' => $login,
|
||||
'page' => 'infosLogin',
|
||||
'params' => 'Erreur Login/Password',
|
||||
'ipClient' => $ipUtilisateur
|
||||
);
|
||||
$iDbCrm->insert('sdv1.logs', $tabInsert);
|
||||
}
|
||||
}
|
||||
//Authentification de l'utilisateur
|
||||
else
|
||||
{
|
||||
$ref='OK';
|
||||
//Identification utilisateur
|
||||
$connected = true;
|
||||
if ( $isOtherUser && $isAdmin ) {
|
||||
// --- Récupération des informations login
|
||||
$userM = new Application_Model_Sdv1Utilisateurs();
|
||||
$sql = $userM->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(array('u'=>'utilisateurs'), array(
|
||||
'u.login', 'u.id', 'u.email', 'u.password', 'u.idClient', 'u.typeCompte', 'u.actif',
|
||||
'u.filtre_ip', 'u.profil', 'u.civilite', 'u.nom', 'u.prenom', 'u.tel', 'u.fax',
|
||||
'u.mobile', 'u.pref', 'u.rechRefType', 'u.profil', 'u.nombreConnexions',
|
||||
'u.dateDerniereConnexion', 'u.droits', 'u.referenceParDefaut', 'u.nbReponses', 'u.lang',
|
||||
'u.formatMail', 'u.dateDebutCompte', 'u.dateFinCompte', 'u.accesWS', 'u.acceptationCGU'))
|
||||
->join(array('c'=>'clients'), 'u.idClient = c.id', array(
|
||||
'c.droits AS droitsClients', 'c.test AS clientTest', 'c.typeScore', 'c.timeout' ))
|
||||
->joinLeft(array('s'=>'sdv1.utilisateurs_service'), 'u.login=s.login', array('Service AS serviceCode'))
|
||||
->joinLeft(array('v'=>'sdv1.clients_version'), 'u.idClient=v.clientId', array('version'))
|
||||
->where('u.actif=?', 1)
|
||||
->where('u.deleted=?', 0)
|
||||
->where('c.actif=?','Oui')->where('u.login=?', $login);
|
||||
|
||||
$result->connected = $connected;
|
||||
$result->login = $this->User->login;
|
||||
$result->id = $this->User->id;
|
||||
$result->idClient = $this->User->idClient;
|
||||
$result->email = $this->User->email;
|
||||
$result->typeCompte = $this->User->typeCompte;
|
||||
$result->filtre_ip = $this->User->filtre_ip;
|
||||
$result->ipPasserelle = $this->User->ipConnexion;
|
||||
$result->ipConnexion = $ipUtilisateur;
|
||||
$result->civilite = $this->User->civilite;
|
||||
$result->nom = $this->User->nom;
|
||||
$result->prenom = $this->User->prenom;
|
||||
$result->raisonSociale = $this->User->raisonSociale;
|
||||
$result->siret = $this->User->siret;
|
||||
$result->adrNum = $this->User->adrNum;
|
||||
$result->adrIndRep = $this->User->adrIndRep;
|
||||
$result->adrTypeVoie = $this->User->adrTypeVoie;
|
||||
$result->adrLibVoie = $this->User->adrLibVoie;
|
||||
$result->adrCp = $this->User->adrCp;
|
||||
$result->adrVille = $this->User->adrVille;
|
||||
$result->adrComp = $this->User->adrComp;
|
||||
$result->tel = $this->User->tel;
|
||||
$result->fax = $this->User->fax;
|
||||
$result->mobile = $this->User->mobile;
|
||||
$result->pref = $this->User->pref;
|
||||
$result->profil = $this->User->profil;
|
||||
$result->dateInscription = $this->User->dateInscription;
|
||||
$result->dateValidation = $this->User->dateValidation;
|
||||
$result->nombreConnexions = $this->User->nombreConnexions;
|
||||
$result->dateDerniereConnexion = $this->User->dateDerniereConnexion;
|
||||
// v2 auth return an array
|
||||
if ( is_array($this->User->droits) ) {
|
||||
$result->droits = join(' ', $this->User->droits);
|
||||
} else {
|
||||
$result->droits = $this->User->droits;
|
||||
}
|
||||
$result->droitsClients = $this->User->droitsClients;
|
||||
$result->timeout = $this->User->timeout;
|
||||
$result->clientTest = $this->User->clientTest;
|
||||
$result->typeScore = $this->User->typeScore;
|
||||
$result->nbReponses = $this->User->nbReponses;
|
||||
$result->lang = $this->User->lang;
|
||||
$result->formatMail = $this->User->formatMail;
|
||||
$result->reference = $this->User->referenceParDefaut;
|
||||
$result->dateDebutCompte = $this->User->dateDebutCompte;
|
||||
$result->dateFinCompte = $this->User->dateFinCompte;
|
||||
$result->maxFicheId = $this->User->maxFicheId;
|
||||
$result->typeScore = $this->User->typeScore;
|
||||
$result->acceptationCGU = $this->User->acceptationCGU;
|
||||
$resultUser = $userM->fetchRow($sql);
|
||||
|
||||
// On log l'accès à l'authentification
|
||||
if ( $this->User->clientTest=='Oui' || $this->User->typeCompte=='TEST' ) {
|
||||
$test = 1;
|
||||
} else {
|
||||
$test = 0;
|
||||
}
|
||||
$tabInsert = array(
|
||||
'login' => $this->User->login,
|
||||
'idClient' => $this->User->idClient,
|
||||
'page' => 'infosLogin',
|
||||
'params' => $ref,
|
||||
'test' => $test,
|
||||
'ipClient' => $ipUtilisateur
|
||||
);
|
||||
$iDbCrm = new WDB();
|
||||
$iDbCrm->insert('sdv1.logs', $tabInsert);
|
||||
|
||||
//Date de dernière connexion
|
||||
$iDbCrm->update('sdv1.utilisateurs',
|
||||
array('dateDerniereConnexion'=> date('Y-m-d H:i:s')),
|
||||
"idClient=".$this->User->idClient." AND login='".$this->User->login."'"
|
||||
);
|
||||
}
|
||||
$timeOutSec = $resultUser->timeout;
|
||||
if ($timeOutSec==0) $timeOutSec = 1800;
|
||||
|
||||
//Retour
|
||||
$result->login = $resultUser->login;
|
||||
$result->id = $resultUser->id;
|
||||
$result->email = $resultUser->email;
|
||||
$result->typeCompte = $resultUser->typeCompte;
|
||||
$result->idClient = $resultUser->idClient;
|
||||
$result->filtre_ip = $resultUser->filtre_ip;
|
||||
$result->civilite = $resultUser->civilite;
|
||||
$result->nom = $resultUser->nom;
|
||||
$result->prenom = $resultUser->prenom;
|
||||
$result->raisonSociale = $resultUser->raisonSociale;
|
||||
$result->siret = $resultUser->siret;
|
||||
$result->adrNum = $resultUser->adrNum;
|
||||
$result->adrIndRep = $resultUser->adrIndRep;
|
||||
$result->adrTypeVoie = $resultUser->adrTypeVoie;
|
||||
$result->adrLibVoie = $resultUser->adrLibVoie;
|
||||
$result->adrCp = $resultUser->adrCp;
|
||||
$result->adrVille = $resultUser->adrVille;
|
||||
$result->adrComp = $resultUser->adrComp;
|
||||
$result->tel = $resultUser->tel;
|
||||
$result->fax = $resultUser->fax;
|
||||
$result->mobile = $resultUser->mobile;
|
||||
$result->pref = $resultUser->pref;
|
||||
$result->profil = $resultUser->profil;
|
||||
$result->dateInscription = $resultUser->dateInscription;
|
||||
$result->dateValidation = $resultUser->dateValidation;
|
||||
$result->nombreConnexions = $resultUser->nombreConnexions;
|
||||
$result->dateDerniereConnexion = $resultUser->dateDerniereConnexion;
|
||||
$result->droits = $resultUser->droits;
|
||||
$result->droitsClients = $resultUser->droitsClients;
|
||||
$result->timeout = $timeOutSec;
|
||||
$result->clientTest = $resultUser->clientTest;
|
||||
$result->typeScore = $resultUser->typeScore;
|
||||
$result->nbReponses = $resultUser->nbReponses;
|
||||
$result->lang = $resultUser->lang;
|
||||
$result->formatMail = $resultUser->formatMail;
|
||||
$result->reference = $resultUser->referenceParDefaut;
|
||||
$result->dateDebutCompte = $resultUser->dateDebutCompte;
|
||||
$result->dateFinCompte = $resultUser->dateFinCompte;
|
||||
$result->maxFicheId = $resultUser->maxFicheId;
|
||||
}
|
||||
// --- Récupération des données utilisateurs inscrite dans le server
|
||||
else {
|
||||
$result->login = $this->User->login;
|
||||
$result->id = $this->User->id;
|
||||
$result->idClient = $this->User->idClient;
|
||||
$result->email = $this->User->email;
|
||||
$result->typeCompte = $this->User->typeCompte;
|
||||
$result->filtre_ip = $this->User->filtre_ip;
|
||||
$result->ipPasserelle = $this->User->ipConnexion;
|
||||
$result->ipConnexion = $ipUtilisateur;
|
||||
$result->civilite = $this->User->civilite;
|
||||
$result->nom = $this->User->nom;
|
||||
$result->prenom = $this->User->prenom;
|
||||
$result->raisonSociale = '';
|
||||
$result->siret = '';
|
||||
$result->adrNum = '';
|
||||
$result->adrIndRep = '';
|
||||
$result->adrTypeVoie = '';
|
||||
$result->adrLibVoie = '';
|
||||
$result->adrCp = '';
|
||||
$result->adrVille = '';
|
||||
$result->adrComp = '';
|
||||
$result->tel = $this->User->tel;
|
||||
$result->fax = $this->User->fax;
|
||||
$result->mobile = $this->User->mobile;
|
||||
$result->pref = $this->User->pref;
|
||||
$result->profil = $this->User->profil;
|
||||
$result->dateInscription = $this->User->dateInscription;
|
||||
$result->dateValidation = $this->User->dateValidation;
|
||||
$result->nombreConnexions = $this->User->nombreConnexions;
|
||||
$result->dateDerniereConnexion = $this->User->dateDerniereConnexion;
|
||||
// v2 auth return an array
|
||||
if ( is_array($this->User->droits) ) {
|
||||
$result->droits = join(' ', $this->User->droits);
|
||||
} else {
|
||||
$result->droits = $this->User->droits;
|
||||
}
|
||||
$result->droitsClients = $this->User->droitsClients;
|
||||
$result->timeout = $this->User->timeout;
|
||||
$result->clientTest = $this->User->clientTest;
|
||||
$result->typeScore = $this->User->typeScore;
|
||||
$result->nbReponses = $this->User->nbReponses;
|
||||
$result->lang = $this->User->lang;
|
||||
$result->formatMail = $this->User->formatMail;
|
||||
$result->reference = $this->User->referenceParDefaut;
|
||||
$result->dateDebutCompte = $this->User->dateDebutCompte;
|
||||
$result->dateFinCompte = $this->User->dateFinCompte;
|
||||
$result->maxFicheId = $this->User->maxFicheId;
|
||||
$result->typeScore = $this->User->typeScore;
|
||||
$result->acceptationCGU = $this->User->acceptationCGU;
|
||||
|
||||
// --- On log l'accès à l'authentification
|
||||
if ($from == 'auth') {
|
||||
$dateConnexion = date('YmdHis');
|
||||
$data = array(
|
||||
'login' => $this->User->login,
|
||||
'authenticate' => 'OK',
|
||||
'ip' => $ipUtilisateur,
|
||||
'dateInsert' => $dateConnexion,
|
||||
);
|
||||
try {
|
||||
$authLogM = new Application_Model_Sdv1UtilisateursAuthLog();
|
||||
$authLogM->insert($data);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->id == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// --- Date de dernière connexion
|
||||
try {
|
||||
$userM = new Application_Model_Sdv1Utilisateurs();
|
||||
$userM->update(array(
|
||||
'dateDerniereConnexion'=> $dateConnexion
|
||||
), "id=".$this->User->id);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->id == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Retour
|
||||
$output = new InfosLoginReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
@ -883,6 +888,7 @@ class Gestion extends Scores_Ws_Server
|
||||
{
|
||||
$this->authenticate();
|
||||
$result = false;
|
||||
$nb = 0;
|
||||
//Pas SuperAdministrateur
|
||||
if ($this->User->profil!='SuperAdministrateur') {
|
||||
throw new SoapFault(1, 'Profil insuffisant pour cette méthode');
|
||||
@ -1071,11 +1077,21 @@ class Gestion extends Scores_Ws_Server
|
||||
|
||||
$iDbCrm = new WDB();
|
||||
if (empty($idClient)){
|
||||
//Ajout
|
||||
// --- Ajout
|
||||
$tabInfos['dateInsert'] = date('Y-m-d H:i:s');
|
||||
$result = $iDbCrm->insert('sdv1.clients', $tabInfos, true);
|
||||
try {
|
||||
$clientM = new Application_Model_Sdv1Clients();
|
||||
$nb = $clientM->insert($tabInfos);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->id == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Création impossible");
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
//Droits client actuel avant modification
|
||||
// --- Droits client actuel avant modification
|
||||
if ( isset($tabInfos['droits']) ) {
|
||||
$rep = $iDbCrm->select('sdv1.clients', 'droits', "id='$idClient'", false, MYSQL_ASSOC);
|
||||
$droitsPre = explode(' ', $rep[0]['droits']);
|
||||
@ -1089,13 +1105,26 @@ class Gestion extends Scores_Ws_Server
|
||||
}
|
||||
}
|
||||
}
|
||||
//Modification
|
||||
// --- Modification
|
||||
$tabInfos['dateUpdate'] = date('Y-m-d H:i:s');
|
||||
if ($iDbCrm->update('sdv1.clients', $tabInfos, "id='$idClient'", true)){
|
||||
$result = true;
|
||||
|
||||
try {
|
||||
$clientM = new Application_Model_Sdv1Clients();
|
||||
$nb = $clientM->update($tabInfos, "id='$idClient'");
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->id == 1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Création impossible");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($nb > 0) {
|
||||
$result = true;
|
||||
}
|
||||
|
||||
$output = new ClientReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $result;
|
||||
|
@ -28,11 +28,12 @@ class Gestion extends Scores_Ws_Server
|
||||
$this->authIp = $ip;
|
||||
break;
|
||||
}
|
||||
|
||||
//Authentification des applications par login
|
||||
|
||||
// --- Authentification des applications par login
|
||||
$this->authenticate();
|
||||
|
||||
//Enregistrement authentification OK
|
||||
|
||||
// --- Enregistrement authentification OK
|
||||
// @todo : Ajout userAgent
|
||||
try {
|
||||
$authLogM = new Application_Model_Sdv1UtilisateursAuthLog();
|
||||
$authLogM->insert(array(
|
||||
@ -41,7 +42,7 @@ class Gestion extends Scores_Ws_Server
|
||||
'ip' => $ip,
|
||||
));
|
||||
} catch (Zend_Db_Exception $e) {}
|
||||
|
||||
|
||||
|
||||
//Check App authorization - Find Service parameters
|
||||
$serviceM = new Application_Model_Sdv1ClientsServices();
|
||||
@ -57,12 +58,12 @@ class Gestion extends Scores_Ws_Server
|
||||
try {
|
||||
$browserLogM = new Application_Model_Sdv1UtilisateursBrowserLog();
|
||||
$browserLogM->insert(array(
|
||||
'idClient' => $this->User->idClient,
|
||||
'idUser' => $this->User->id,
|
||||
'service' => $this->User->serviceCode,
|
||||
'login' => $this->User->login,
|
||||
'authenticate' => 'OK',
|
||||
'ip' => $ip,
|
||||
'idClient' => $this->User->idClient,
|
||||
'idUser' => $this->User->id,
|
||||
'service' => $this->User->serviceCode,
|
||||
'login' => $this->User->login,
|
||||
'authenticate' => 'OK',
|
||||
'ip' => $ip,
|
||||
));
|
||||
} catch (Zend_Db_Exception $e) {}
|
||||
}
|
||||
@ -175,12 +176,12 @@ class Gestion extends Scores_Ws_Server
|
||||
if ($param->label == 'time') {
|
||||
$time = $param->value;
|
||||
}
|
||||
if ($param->label == 'MAIL') {
|
||||
if ($param->label == 'mail') {
|
||||
$user = $param->value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Limite de temps
|
||||
*/
|
||||
@ -193,6 +194,7 @@ class Gestion extends Scores_Ws_Server
|
||||
*/
|
||||
$data = $user . '/' . $time . '/' . $key;
|
||||
$internalToken = hash('sha256', $data);
|
||||
file_get_contents('inextenso.log', $internalToken .' = '. $token."\n", FILE_APPEND);
|
||||
if ($internalToken == $token) {
|
||||
//Generate random password
|
||||
$hash = password_hash ( uniqid() , PASSWORD_BCRYPT );
|
||||
@ -1075,7 +1077,7 @@ class Gestion extends Scores_Ws_Server
|
||||
} catch ( Zend_Db_Exception $e ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//Prepare data to insert
|
||||
foreach ($infos as $key => $value) {
|
||||
if (array_key_exists($key, $userData)) {
|
||||
|
@ -3305,7 +3305,7 @@ class Interne extends Scores_Ws_Server
|
||||
$hostname.= ':'.$_SERVER['SERVER_PORT'];
|
||||
}
|
||||
$result = new LogsClients();
|
||||
$result->Url = $hostname.DOC_WEB_URL."csv/logs-$annee-$mois-$detail-$idClient-$login-$all.csv";
|
||||
$result->Url = $hostname."/fichier/csv/logs-$annee-$mois-$detail-$idClient-$login-$all.csv";
|
||||
$result->Taille = $size;
|
||||
$result->Cache = $cache;
|
||||
|
||||
|
@ -2612,11 +2612,11 @@ class Interne extends Scores_Ws_Server
|
||||
$hostname.= ':'.$_SERVER['SERVER_PORT'];
|
||||
}
|
||||
$result = new ListeSurveillancesCsv();
|
||||
$result->Url = $hostname.DOC_WEB_URL."csv/listesurv-$source-$login-$idClient.csv";
|
||||
$result->Url = $hostname."/fichier/csv/listesurv-$source-$login-$idClient.csv";
|
||||
$result->Taille = $size;
|
||||
$result->Cache = $cache;
|
||||
|
||||
debugLog('I','getListeSurveillancesCsv Url='.$hostname.DOC_WEB_URL."csv/listesurv-$source-$login-$idClient.csv, Taille=$size, Cache=$cache",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
debugLog('I','getListeSurveillancesCsv Url='.$hostname."/fichier/csv/listesurv-$source-$login-$idClient.csv, Taille=$size, Cache=$cache",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
$output = new ListeSurveillancesCsvReturn();
|
||||
$output->error = $error;
|
||||
|
@ -2570,11 +2570,11 @@ class Interne extends Scores_Ws_Server
|
||||
$hostname.= ':'.$_SERVER['SERVER_PORT'];
|
||||
}
|
||||
$result = new ListeSurveillancesCsv();
|
||||
$result->Url = $hostname.DOC_WEB_URL."csv/listesurv-$source-$login-$idClient.csv";
|
||||
$result->Url = $hostname."/fichier/csv/listesurv-$source-$login-$idClient.csv";
|
||||
$result->Taille = $size;
|
||||
$result->Cache = $cache;
|
||||
|
||||
debugLog('I','getListeSurveillancesCsv Url='.$hostname.DOC_WEB_URL."csv/listesurv-$source-$login-$idClient.csv, Taille=$size, Cache=$cache",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
debugLog('I','getListeSurveillancesCsv Url='.$hostname."/fichier/csv/listesurv-$source-$login-$idClient.csv, Taille=$size, Cache=$cache",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
$output = new ListeSurveillancesCsvReturn();
|
||||
$output->error = $error;
|
||||
|
@ -1494,11 +1494,11 @@ class Interne extends Scores_Ws_Server
|
||||
$hostname.= ':'.$_SERVER['SERVER_PORT'];
|
||||
}
|
||||
$result = new ListeSurveillancesCsv();
|
||||
$result->Url = $hostname.DOC_WEB_URL."csv/listesurv-$source-$login-$idClient.csv";
|
||||
$result->Url = $hostname."/fichier/csv/listesurv-$source-$login-$idClient.csv";
|
||||
$result->Taille = $size;
|
||||
$result->Cache = $cache;
|
||||
|
||||
debugLog('I','getListeSurveillancesCsv Url='.$hostname.DOC_WEB_URL."csv/listesurv-$source-$login-$idClient.csv, Taille=$size, Cache=$cache",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
debugLog('I','getListeSurveillancesCsv Url='.$hostname."/fichier/csv/listesurv-$source-$login-$idClient.csv, Taille=$size, Cache=$cache",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
$output = new ListeSurveillancesCsvReturn();
|
||||
$output->error = $error;
|
||||
|
@ -1367,8 +1367,9 @@ class Interne extends Scores_Ws_Server
|
||||
// Surveillances de tous les utilisateurs du client
|
||||
if (empty($login)) {
|
||||
$login = '';
|
||||
}
|
||||
//Surveillances de l'utilisateur
|
||||
} else {
|
||||
else {
|
||||
$strLogin = "AND s.login='$login' ";
|
||||
}
|
||||
} else {
|
||||
@ -1429,11 +1430,11 @@ class Interne extends Scores_Ws_Server
|
||||
$hostname.= ':'.$_SERVER['SERVER_PORT'];
|
||||
}
|
||||
$result = new ListeSurveillancesCsv();
|
||||
$result->Url = $hostname.DOC_WEB_URL."csv/listesurv-$source-$login-$idClient.csv";
|
||||
$result->Url = $hostname."/fichier/csv/listesurv-$source-$login-$idClient.csv";
|
||||
$result->Taille = $size;
|
||||
$result->Cache = $cache;
|
||||
|
||||
debugLog('I','getListeSurveillancesCsv Url='.$hostname.DOC_WEB_URL."csv/listesurv-$source-$login-$idClient.csv, Taille=$size, Cache=$cache",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
debugLog('I','getListeSurveillancesCsv Url='.$hostname."/fichier/csv/listesurv-$source-$login-$idClient.csv, Taille=$size, Cache=$cache",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
$output = new ListeSurveillancesCsvReturn();
|
||||
$output->error = $error;
|
||||
|
@ -3,9 +3,9 @@ require_once __DIR__ . '/Types.php';
|
||||
|
||||
class Monitoring extends Scores_Ws_Server
|
||||
{
|
||||
|
||||
|
||||
protected function getSurveillances($source){}
|
||||
protected function getSurveillance($){}
|
||||
protected function getSurveillance(){}
|
||||
protected function getSurveillanceById(){}
|
||||
|
||||
|
||||
}
|
@ -59,6 +59,7 @@ class Pieces extends Scores_Ws_Server
|
||||
'siren' => $siren,
|
||||
'raisonSociale' => $identite['Nom'],
|
||||
'dateInsert' => date('YmdHis'),
|
||||
'dateCommande' => date('YmdHis'),
|
||||
));
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
|
||||
@ -94,7 +95,7 @@ class Pieces extends Scores_Ws_Server
|
||||
$this->wsLog('kbis', $siren, basename($filepdf));
|
||||
$commandeM->update(array('dateEnvoi'=> date('YmdHis')), 'id='.$id);
|
||||
|
||||
return $hostname.DOC_WEB_URL.'kbis/'.basename($filepdf);
|
||||
return $hostname.'/fichier/kbis/'.basename($filepdf);
|
||||
|
||||
} else {
|
||||
|
||||
@ -149,7 +150,7 @@ class Pieces extends Scores_Ws_Server
|
||||
|
||||
$commandeM->update(array('dateEnvoi'=> date('YmdHis')), 'id='.$id);
|
||||
|
||||
return $hostname.DOC_WEB_URL.'kbis/'.basename($filepdf);
|
||||
return $hostname.'/fichier/kbis/'.basename($filepdf);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -235,8 +236,10 @@ class Pieces extends Scores_Ws_Server
|
||||
if( $bilans->count() > 0) {
|
||||
foreach ($bilans as $item) {
|
||||
|
||||
$filename = basename($item->pdfLink);
|
||||
$file = SECURE_STORAGE . 'association/bilans/' . $filename;
|
||||
$filename = basename($item->pdfLink);
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->secure.'/association/bilans/' . $filename;
|
||||
|
||||
$bilansList = new Bilan();
|
||||
$bilansList->DateCloture = substr($item->dateCloture,0,4).substr($item->dateCloture,5,2).substr($item->dateCloture,8,2);
|
||||
|
@ -1454,7 +1454,7 @@ class Saisie extends Scores_Ws_Server
|
||||
}
|
||||
}
|
||||
// --- End of Mathematic control
|
||||
|
||||
|
||||
if ( $step == 'onlycheck' ) {
|
||||
return 1;
|
||||
}
|
||||
@ -1874,7 +1874,9 @@ class Saisie extends Scores_Ws_Server
|
||||
$lienrefM = new Application_Model_JoLiensRef();
|
||||
$sql = $lienrefM->select()->where('siren=?',$id);
|
||||
$row = $lienrefM->fetchRow($sql);
|
||||
$idNum = $row->id;
|
||||
if (null !== $row) {
|
||||
$idNum = $row->id;
|
||||
}
|
||||
$type = 'Entreprise';
|
||||
}
|
||||
//Type = Lien
|
||||
@ -2617,7 +2619,7 @@ class Saisie extends Scores_Ws_Server
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set geocode from web application
|
||||
* @param string $companyId
|
||||
@ -2633,7 +2635,7 @@ class Saisie extends Scores_Ws_Server
|
||||
{
|
||||
$this->authenticate();
|
||||
$siren = null;
|
||||
|
||||
|
||||
// --- Identifiant SD : source + id
|
||||
if ($type === null) {
|
||||
|
||||
@ -2648,7 +2650,7 @@ class Saisie extends Scores_Ws_Server
|
||||
else {
|
||||
throw new SoapFault('ERR', 'Type identifiant inconnu.');
|
||||
}
|
||||
|
||||
|
||||
// --- Lecture de l'adresse
|
||||
try {
|
||||
$etablissementM = new Application_Model_JoEtablissements();
|
||||
@ -2672,20 +2674,20 @@ class Saisie extends Scores_Ws_Server
|
||||
if ($result === null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// --- Result from database
|
||||
$AdresseNum = $result->adr_num;
|
||||
$AdresseTypeVoie = $result->adr_typeVoie;
|
||||
$AdresseLibVoie = $result->adr_libVoie;
|
||||
$AdresseCP = $result->adr_cp;
|
||||
$AdresseVille = $result->adr_ville;
|
||||
|
||||
|
||||
$insee = new MInsee();
|
||||
$AdresseTypeVoieLong = $insee->getCodeVoie($AdresseTypeVoie);
|
||||
|
||||
$AdresseTypeVoieLong = strtoupper($insee->getCodeVoie($AdresseTypeVoie));
|
||||
|
||||
// --- Format adress
|
||||
$adressPrimary = trim(preg_replace('/ +/',' ', "$AdresseNum $AdresseTypeVoieLong $AdresseLibVoie"));
|
||||
|
||||
|
||||
// --- Code Rivoli
|
||||
$codeRivoli = '';
|
||||
try {
|
||||
@ -2713,7 +2715,7 @@ class Saisie extends Scores_Ws_Server
|
||||
$codeRivoli = $result->ADR_DEP.$result->ADR_COM.$result->CODEVOIE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// --- Prepare geocoding
|
||||
try {
|
||||
$zonageM = new Application_Model_JoZonageXY();
|
||||
@ -2734,12 +2736,15 @@ class Saisie extends Scores_Ws_Server
|
||||
} else {
|
||||
$tableModif = 'update';
|
||||
}
|
||||
|
||||
|
||||
$output = 0;
|
||||
$data = json_decode($data);
|
||||
if (!empty($data->lat) && !empty($data->lng)) {
|
||||
$precision = 0;
|
||||
$dataGeocode = array();
|
||||
|
||||
// --- Source Google
|
||||
if ( strtolower($data->source) == 'google' ) {
|
||||
$precision = 0;
|
||||
switch($data->precis) {
|
||||
/**
|
||||
* Precise geocode for which we have location information accurate down to street address precision.
|
||||
@ -2767,7 +2772,7 @@ class Saisie extends Scores_Ws_Server
|
||||
$precision = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
require_once 'Metier/partenaires/classMMap.php';
|
||||
$lambert = geos2lambert93($data->lat, $data->lng);
|
||||
$dataGeocode = array(
|
||||
@ -2779,7 +2784,7 @@ class Saisie extends Scores_Ws_Server
|
||||
'adrTypeVoie' => $AdresseTypeVoie,
|
||||
'adrLibVoie' => $AdresseLibVoie,
|
||||
'rivoli' => $codeRivoli,
|
||||
'adresseValidee' => $data->address,
|
||||
'adresseValidee' => urldecode($data->address),
|
||||
'lat' => $data->lat,
|
||||
'lon' => $data->lng,
|
||||
'l93_x' => $lambert['x_93'],
|
||||
@ -2790,23 +2795,52 @@ class Saisie extends Scores_Ws_Server
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
if ($tableModif == 'insert') {
|
||||
$dataGeocode['dateInsert'] = date('YmdHis');
|
||||
$output = $zonageM->insert($dataGeocode);
|
||||
} else {
|
||||
$output = $zonageM->update($dataGeocode, array('address=?'=>$adressPrimary));
|
||||
if (count($dataGeocode) > 0) {
|
||||
try {
|
||||
if ($tableModif == 'insert') {
|
||||
$dataGeocode['dateInsert'] = date('YmdHis');
|
||||
$output = $zonageM->insert($dataGeocode);
|
||||
} else {
|
||||
$output = $zonageM->update($dataGeocode, array(
|
||||
'address=?' => $adressPrimary,
|
||||
'adr_cp=?' => $AdresseCP,
|
||||
'adr_ville=?' => $AdresseVille,
|
||||
));
|
||||
}
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient==1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
if ($this->User->idClient==1) {
|
||||
throw new SoapFault('ERR', $e->getMessage());
|
||||
} else {
|
||||
throw new SoapFault('ERR', "Application error");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
protected function getLienUser($id, $type = null)
|
||||
{
|
||||
$this->authenticate();
|
||||
//InsertId
|
||||
//InsertUser
|
||||
//InsertDate
|
||||
//UpdateId
|
||||
//UpdateUser
|
||||
//UpdateDate
|
||||
}
|
||||
|
||||
protected function getLienRefUser($id, $type = null)
|
||||
{
|
||||
$this->authenticate();
|
||||
|
||||
//InsertId
|
||||
//InsertUser
|
||||
//InsertDate
|
||||
//UpdateId
|
||||
//UpdateUser
|
||||
//UpdateDate
|
||||
}
|
||||
|
||||
}
|
@ -1,25 +1,14 @@
|
||||
--
|
||||
-- Structure de la table `utilisateurs_emails`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `utilisateurs_emails` (
|
||||
`id` int(11) NOT NULL,
|
||||
`idClient` int(11) NOT NULL COMMENT 'ID du client',
|
||||
`login` varchar(50) NOT NULL COMMENT 'login de l''utilisateur',
|
||||
`emailName` varchar(50) NOT NULL DEFAULT '' COMMENT 'Nom à afficher',
|
||||
`email` varchar(255) NOT NULL COMMENT 'email de l''utilisateur',
|
||||
`account` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Email principal identique compte utilisateur',
|
||||
`pSurveillance` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'email à utiliser pour la prestation surveillance',
|
||||
`valid` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 si email validé',
|
||||
`validToken` varchar(40) NOT NULL DEFAULT '' COMMENT 'Clé généré pour la validation par lien de l''email'
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
|
||||
|
||||
--
|
||||
-- Index pour les tables exportées
|
||||
--
|
||||
|
||||
--
|
||||
-- Index pour la table `utilisateurs_emails`
|
||||
--
|
||||
ALTER TABLE `utilisateurs_emails`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
CREATE TABLE `utilisateurs_emails` (
|
||||
`id` int(11) NOT NULL,
|
||||
`idClient` int(11) NOT NULL COMMENT 'ID du client',
|
||||
`login` varchar(50) NOT NULL COMMENT 'login de l''utilisateur',
|
||||
`name` varchar(50) NOT NULL DEFAULT '' COMMENT 'Nom à afficher',
|
||||
`email` varchar(255) NOT NULL COMMENT 'email de l''utilisateur',
|
||||
`valid` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 si email valide',
|
||||
`validToken` varchar(40) NOT NULL DEFAULT '' COMMENT 'Clé pour la validation par lien de l''email',
|
||||
`dateInsert` datetime NOT NULL,
|
||||
`dateUpdate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idClient` (`idClient`),
|
||||
KEY `login` (`login`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
Loading…
Reference in New Issue
Block a user