Diverses corrections

This commit is contained in:
Michael RICOIS 2015-07-05 19:29:02 +00:00
parent f7763a5404
commit 5dfb7f42d2
8 changed files with 55 additions and 152 deletions

View File

@ -740,4 +740,8 @@ return array(
'000Z' => "00Z",
'526D' => "526D",
'8121' => "8121",
'7904' => "7904",
'745A' => "745A",
'702A' => "702A",
'702C' => "702C",
);

View File

@ -1484,4 +1484,8 @@ return array(
'000Z' => "",
'526D' => "",
'8121' => "",
'7904' => "",
'745A' => "",
'702A' => "",
'702C' => "",
);

View File

@ -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";

View File

@ -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(
@ -797,44 +797,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';
}
}
}

View File

@ -1,111 +0,0 @@
<?php
class Configure
{
/**
* Configuration object
* @var Zend_Config_Ini
*/
protected $profil;
public function __construct()
{
$this->readConfig();
$this->_defineDb();
$this->_definePath();
$this->_defineSphinx();
$this->_defineMail();
$this->_defineInfogreffe();
}
/**
* Read config application.ini
*/
protected function readConfig()
{
if ( Zend_Registry::isRegistered('config') ) {
$c = Zend_Registry::get('config');
$this->profil = $c->profil;
} else {
$c = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', 'production');
$this->profil = $c->profil;
}
}
protected function _defineDb()
{
if ( $this->profil->db->metier ) {
define('MYSQL_HOST', $this->profil->db->metier->params->host);
define('MYSQL_USER', $this->profil->db->metier->params->username);
define('MYSQL_PASS', $this->profil->db->metier->params->password);
define('MYSQL_DEFAULT_DB', 'jo');
define('MYSQL_SQL_LOG', 'NONE');
}
}
protected function _definePath()
{
//Use of realpath
define('BODACC_LOCAL_DIR' , '/home/data/bodacc/');
define('JAL_LOCAL_DIR' , '/home/data/jal/');
define('HUGIN_LOCAL_DIR' , '/home/data/infosreg/hugin/');
define('ACTUSNEWS_LOCAL_DIR' , '/home/data/infosreg/actusnews/');
define('DIRELEASE_LOCAL_DIR' , '/home/data/infosreg/direlease/');
define('LESECHOS_LOCAL_DIR' , '/home/data/infosreg/lesechos/');
define('BUSINESSWIRE_LOCAL_DIR_INCOMING' , '/home/data/ftp/businesswire/');
define('BUSINESSWIRE_LOCAL_DIR' , '/home/data/infosreg/businesswire/');
define('SECURE_STORAGE' , $this->profil->path->secure.'/');
define('DOC_WEB_LOCAL' , $this->profil->path->files.'/');
define('DOC_WEB_URL' , '/fichier/');
define('LOG_PATH' , $this->profil->path->data.'/log');
}
protected function _defineSphinx()
{
// Entreprise
define('SPHINX_ENT_HOST', $this->profil->sphinx->ent->host);
define('SPHINX_ENT_PORT', intval($this->profil->sphinx->ent->port));
define('SPHINX_ENT_VERSION', $this->profil->sphinx->ent->version);
// Dirigeants
define('SPHINX_DIR_HOST', $this->profil->sphinx->dir->host);
define('SPHINX_DIR_PORT', intval($this->profil->sphinx->dir->port));
define('SPHINX_DIR_VERSION', $this->profil->sphinx->dir->version);
// Historique
define('SPHINX_HISTO_HOST', $this->profil->sphinx->histo->host);
define('SPHINX_HISTO_PORT', intval($this->profil->sphinx->histo->port));
define('SPHINX_HISTO_VERSION', $this->profil->sphinx->histo->version);
// Actionnaire
define('SPHINX_ACT_HOST', $this->profil->sphinx->act->host);
define('SPHINX_ACT_PORT', intval($this->profil->sphinx->act->port));
define('SPHINX_ACT_VERSION', $this->profil->sphinx->act->version);
//Old
define('SPHINX_HOST', $this->profil->sphinx->ent->host);
define('SPHINX_PORT', intval($this->profil->sphinx->ent->port));
}
protected function _defineMail()
{
//Messagerie
define('SMTP_HOST', $this->profil->mail->smtp_host);
define('SMTP_PORT', $this->profil->mail->smtp_port);
define('SMTP_USER', '');
define('SMTP_PASS', '');
}
protected function _defineInfogreffe()
{
define('INFOGREFFE_DISPO_WEB', false);
define('INFOGREFFE_DISPO_WS', false);
define('INFOGREFFE_WS_URL', 'https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE');
define('INFOGREFFE_WS_USER', '85000109');
define('INFOGREFFE_WS_PASS', '166');
}
}

View File

@ -4294,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) {
@ -4304,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

View File

@ -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 {

View File

@ -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(){}
}