This commit is contained in:
Michael RICOIS 2009-02-23 18:40:34 +00:00
parent 0647f391b7
commit 8331a61e25
3 changed files with 21 additions and 9 deletions

View File

@ -8,8 +8,7 @@
** "body" => Page HTML ** "body" => Page HTML
**/ **/
function parse_response($this_response) { function parse_response($this_response) {
// Split response into header and body sections // Split response into header and body sections
list($response_headers, $response_body) = explode("\r\n\r\n", $this_response, 2); list($response_headers, $response_body) = explode("\r\n\r\n", $this_response, 2);
$response_header_lines = explode("\r\n", $response_headers); $response_header_lines = explode("\r\n", $response_headers);
@ -105,9 +104,14 @@ function getUrl($url, $strCookies='', $postData='', $referer='', $debug=false, $
} }
curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header); curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
//print_r($this_header); //print_r($this_header);
$page=curl_exec($ch); $page=curl_exec($ch);
if($page === false)
{
echo 'Erreur Curl : ' . curl_error($ch);
}
$response = parse_response($page); $response = parse_response($page);
if ($debug){ if ($debug){
$url2=str_replace('http://', '', $url); $url2=str_replace('http://', '', $url);

View File

@ -348,7 +348,8 @@ document.write('<div id="divStayTopLeft" style="position:absolute">')
<? if ($_SESSION['tabInfo']['login']=='reunicacsf' || <? if ($_SESSION['tabInfo']['login']=='reunicacsf' ||
$_SESSION['tabInfo']['login']=='testreunica' || $_SESSION['tabInfo']['login']=='testreunica' ||
$_SESSION['tabInfo']['login']=='ylenaour' || $_SESSION['tabInfo']['login']=='ylenaour' ||
$_SESSION['tabInfo']['login']=='mheitz' || $_SESSION['tabInfo']['login']=='mheitz' ||
$_SESSION['tabInfo']['login']=='mricois' ||
$_SESSION['tabInfo']['login']=='jmartory' ) { ?> $_SESSION['tabInfo']['login']=='jmartory' ) { ?>
<a href="#"><font color="Gray">indiScore + &copy;</font></a> <a href="#"><font color="Gray">indiScore + &copy;</font></a>
<? if (preg_match('/scorecsf/i', $_SESSION['tabInfo']['droits'])) { ?> <? if (preg_match('/scorecsf/i', $_SESSION['tabInfo']['droits'])) { ?>
@ -360,7 +361,8 @@ document.write('<div id="divStayTopLeft" style="position:absolute">')
<? if ($_SESSION['tabInfo']['login']=='reunicacsf' || <? if ($_SESSION['tabInfo']['login']=='reunicacsf' ||
$_SESSION['tabInfo']['login']=='testreunica' || $_SESSION['tabInfo']['login']=='testreunica' ||
$_SESSION['tabInfo']['login']=='ylenaour' || $_SESSION['tabInfo']['login']=='ylenaour' ||
$_SESSION['tabInfo']['login']=='mheitz' || $_SESSION['tabInfo']['login']=='mheitz' ||
$_SESSION['tabInfo']['login']=='mricois' ||
$_SESSION['tabInfo']['login']=='jmartory' ) { ?> $_SESSION['tabInfo']['login']=='jmartory' ) { ?>
<a href="#"><font color="Gray">indiScore + &copy;</font></a> <a href="#"><font color="Gray">indiScore + &copy;</font></a>
<? if (preg_match('/scorecsf/i', $_SESSION['tabInfo']['droits'])) { ?> <? if (preg_match('/scorecsf/i', $_SESSION['tabInfo']['droits'])) { ?>

View File

@ -106,24 +106,30 @@ $client = new SoapClient(null, array( 'trace' => 1,
$url='https://www.creditsafe.fr/getdata/service/CSFRServices.asmx/GetData?RequestXmlStr='.$req;//.'&RequestXmlString='.$req; $url='https://www.creditsafe.fr/getdata/service/CSFRServices.asmx/GetData?RequestXmlStr='.$req;//.'&RequestXmlString='.$req;
//requestXmlStr. //requestXmlStr.
$referer=$cookie=''; $referer=$cookie='';
$page=getUrl($url, $cookie, '', $referer, false, '', ''); $page=getUrl(htmlspecialchars($url), $cookie, '', $referer, false, '', '');
$referer=$url; $referer=$url;
$xml=html_entity_decode($page['body'], ENT_QUOTES, 'UTF-8');
/*
$fp=@fopen(htmlspecialchars($url), 'rb');
print $content = stream_get_contents($fp);
fclose($fp);
*/
$xml=html_entity_decode($page['body'], ENT_QUOTES, 'UTF-8');
/** Enregistrement du fichier XML en provenance des greffes /** Enregistrement du fichier XML en provenance des greffes
**/ **/
//TODO : Chemin !! //TODO : Chemin !!
$fp=@fopen(realpath(dirname(__FILE__) . '/../creditsafe/xml/'). '/'.$fichier, 'w'); $fp=@fopen(realpath(dirname(__FILE__) . '/../creditsafe/xml/'). '/'.$fichier, 'w');
@fwrite($fp, $xml); @fwrite($fp, $xml);
@fclose($fp); @fclose($fp);
$O = $client->setLog('scorecsf', $siret); $O = $client->setLog('scorecsf', $siret);
} else { } else {
/** Lecture du fichier XML en provenance des greffes /** Lecture du fichier XML en provenance des greffes
**/ **/
//TODO : Chemin !! //TODO : Chemin !!
$xml=file_get_contents(realpath(dirname(__FILE__) . '/../creditsafe/xml/'.$fichier)); $xml=file_get_contents(realpath(dirname(__FILE__) . '/../creditsafe/xml/').'/'.$fichier);
$O = $client->setLog('scorecsf', $siret, 0, 'local'); $O = $client->setLog('scorecsf', $siret, 0, 'local');
} }
/*<>100</rating> /*<>100</rating>
@ -131,7 +137,7 @@ $client = new SoapClient(null, array( 'trace' => 1,
$dom_object = new DomDocument2(); $dom_object = new DomDocument2();
//TODO : Chemin !! //TODO : Chemin !!
$dom_object->load(realpath(dirname(__FILE__) . '/../creditsafe/xml/'.$fichier)); $dom_object->load(realpath(dirname(__FILE__) . '/../creditsafe/xml/').'/'.$fichier);
/* create DOMXPath object with our DOMObject /* create DOMXPath object with our DOMObject
$xpath = new Domxpath($dom_object); $xpath = new Domxpath($dom_object);
$result = $xpath->query("//liste_depot_acte/depot_acte/."); $result = $xpath->query("//liste_depot_acte/depot_acte/.");