Compare commits
3 Commits
SD-32
...
errorsoapt
Author | SHA1 | Date | |
---|---|---|---|
|
bcb2690f3c | ||
|
a6be515460 | ||
|
c709e9c659 |
@ -49,31 +49,21 @@ class ErrorController extends Zend_Controller_Action
|
||||
|
||||
$user = new Scores_Utilisateur();
|
||||
|
||||
//Envoyer les erreurs par mail
|
||||
if (APPLICATION_ENV != 'development') {
|
||||
$message = '';
|
||||
$message.= 'Erreur Applicative : ';
|
||||
$message.= "\n";
|
||||
$message.= 'Message : '.$errors->exception->getMessage();
|
||||
$message.= "\n";
|
||||
$message.= 'Utilisateur : '.$user->getLogin();
|
||||
$message.= "\n";
|
||||
$message.= "File :".$errors->exception->getFile().", Ligne : ".$errors->exception->getLine();
|
||||
$message.= "\n";
|
||||
$message.= "Detail :\n".$errors->exception->getTraceAsString();
|
||||
$message.= "\n\n";
|
||||
$message.= "Request Parameters :\n ".print_r($this->getRequest()->getParams(), true)."\n";
|
||||
$message = '';
|
||||
$message.= 'Erreur Applicative : ';
|
||||
$message.= "\n";
|
||||
$message.= 'Message : '.$errors->exception->getMessage();
|
||||
$message.= "\n";
|
||||
$message.= 'Utilisateur : '.$user->getLogin();
|
||||
$message.= "\n";
|
||||
$message.= "File :".$errors->exception->getFile().", Ligne : ".$errors->exception->getLine();
|
||||
$message.= "\n";
|
||||
$message.= "Detail :\n".$errors->exception->getTraceAsString();
|
||||
$message.= "\n\n";
|
||||
$message.= "Request Parameters :\n ".print_r($this->getRequest()->getParams(), true)."\n";
|
||||
$message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n";
|
||||
$this->logger->error($message);
|
||||
|
||||
$message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n";
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setSubject('[ERREUR APPLICATIVE] - '.$c->profil->server->name.' -'.date('Ymd'));
|
||||
$mail->setBodyText($message);
|
||||
$mail->setFromKey('support');
|
||||
$mail->addToKey('supportdev');
|
||||
$mail->execute();
|
||||
}
|
||||
// Log exception, if logger available
|
||||
if ($log = $this->getLog()) {
|
||||
$log->crit($this->view->message, $errors->exception);
|
||||
|
@ -365,10 +365,10 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$user = new Scores_Utilisateur();
|
||||
|
||||
//Pagination
|
||||
$request = $this->getRequest();
|
||||
$page = $request->getParam('page', 1);
|
||||
if ( $page <= 0 ) $page = 1;
|
||||
$nbAffichage = 50;
|
||||
$request = $this->getRequest();
|
||||
$page = $request->getParam('page', 1);
|
||||
if ( $page <= 0 ) $page = 1;
|
||||
$nbAffichage = 50;
|
||||
$position = ($page - 1 ) * $nbAffichage;
|
||||
|
||||
$ws = new WsScores();
|
||||
@ -391,26 +391,26 @@ class IdentiteController extends Zend_Controller_Action
|
||||
}
|
||||
}
|
||||
|
||||
//Calcul pagination
|
||||
$nbReponses = count($infos->result->item);
|
||||
$nbReponsesTotal = $infos->nbReponses;
|
||||
if ($nbReponses < $nbReponsesTotal) {
|
||||
$pageTotal = ceil( $nbReponsesTotal / $nbAffichage );
|
||||
$pageCurrent = $page;
|
||||
$pagePrev = $page - 1;
|
||||
if ($pagePrev < 1) {
|
||||
$pagePrev = 1;
|
||||
}
|
||||
$pageNext = $page + 1;
|
||||
if( $pageNext > $pageTotal ) {
|
||||
$pageNext = $pageTotal;
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
$this->view->assign('PageNext', $pageNext);
|
||||
//Calcul pagination
|
||||
$nbReponses = count($infos->result->item);
|
||||
$nbReponsesTotal = $infos->nbReponses;
|
||||
if ($nbReponses < $nbReponsesTotal) {
|
||||
$pageTotal = ceil( $nbReponsesTotal / $nbAffichage );
|
||||
$pageCurrent = $page;
|
||||
$pagePrev = $page - 1;
|
||||
if ($pagePrev < 1) {
|
||||
$pagePrev = 1;
|
||||
}
|
||||
$pageNext = $page + 1;
|
||||
if( $pageNext > $pageTotal ) {
|
||||
$pageNext = $pageTotal;
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
$this->view->assign('PageNext', $pageNext);
|
||||
$this->view->assign('PageCurrent', $pageCurrent);
|
||||
|
||||
$this->view->assign('nbEtabActif', $nbEtabActif);
|
||||
@ -699,7 +699,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$session = new Scores_Session_Entreprise($siren, null, true);
|
||||
$this->view->assign('siren', $siren);
|
||||
$this->view->assign('siret', $session->getSiret());
|
||||
$this->view->assign('isin', $session->getIsin());
|
||||
$this->view->assign('isin', $session->getIsin());
|
||||
$this->view->assign('surveillance', $user->checkPerm('survdirigeants'));
|
||||
}
|
||||
|
||||
@ -725,7 +725,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$this->view->assign('isin', $session->getIsin());
|
||||
$this->view->assign('siren', $siren);
|
||||
$this->view->assign('siret', $this->siret);
|
||||
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
||||
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
||||
$this->view->assign('surveillance', $user->checkPerm('liens'));
|
||||
|
||||
//Check access to display group link
|
||||
@ -748,18 +748,18 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$this->view->assign('PP', true);
|
||||
|
||||
//@todo : using this function is strange - How to get the id before ?
|
||||
$result = $ws->searchLienRef($siren, 'siren');
|
||||
if (count($result->item)>0) {
|
||||
foreach ($result->item as $item) {
|
||||
$id = $item->id;
|
||||
break;
|
||||
}
|
||||
$result = $ws->searchLienRef($siren, 'siren');
|
||||
if (count($result->item)>0) {
|
||||
foreach ($result->item as $item) {
|
||||
$id = $item->id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$result = $ws->getLienRef($id);
|
||||
$this->view->assign('nom', $result->nom);
|
||||
$this->view->assign('prenom', $result->prenom);
|
||||
$this->view->assign('civilite', $result->civilite);
|
||||
$this->view->assign('nom', $result->nom);
|
||||
$this->view->assign('prenom', $result->prenom);
|
||||
$this->view->assign('civilite', $result->civilite);
|
||||
$this->view->assign('naissanceDate', $result->naissance_Date);
|
||||
}
|
||||
|
||||
@ -1233,55 +1233,49 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
// --- En environement de preprod, on envoi sur le site
|
||||
if (APPLICATION_ENV == 'staging') {
|
||||
$this->redirect('http://avis-situation-sirene.insee.fr/');
|
||||
}
|
||||
// --- Téléchargement du fichier et distribution
|
||||
else {
|
||||
$avis = new Scores_Insee_AvisSituation($this->siret);
|
||||
if ( !$avis->erreur() ) {
|
||||
$avis->erreurcpt('raz');
|
||||
$file = $avis->get();
|
||||
if ($file === false) {
|
||||
$avis->erreurcpt('plus');
|
||||
echo $avis->erreurmsg();
|
||||
} else {
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
$content_type = 'application/pdf';
|
||||
if ( file_exists($file) ) {
|
||||
$ws = new WsScores();
|
||||
$ws->setLog('avis_situation', $this->siret, 0, '');
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header ('X-Sendfile: ' . $file);
|
||||
header ('Content-Type: ' . $content_type);
|
||||
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
$avis = new Scores_Insee_AvisSituation($this->siret);
|
||||
if ( !$avis->erreur() ) {
|
||||
$avis->erreurcpt('raz');
|
||||
$file = $avis->get();
|
||||
if ($file === false) {
|
||||
$avis->erreurcpt('plus');
|
||||
echo $avis->erreurmsg();
|
||||
} else {
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
$content_type = 'application/pdf';
|
||||
if ( file_exists($file) ) {
|
||||
$ws = new WsScores();
|
||||
$ws->setLog('avis_situation', $this->siret, 0, '');
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header ('X-Sendfile: ' . $file);
|
||||
header ('Content-Type: ' . $content_type);
|
||||
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
echo "Impossible de charger le fichier";
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
echo "Impossible de charger le fichier";
|
||||
}
|
||||
} else {
|
||||
if ($avis->nberreur()==5){
|
||||
$avis->mailerreur();
|
||||
}
|
||||
$avis->erreurcpt('plus');
|
||||
echo $avis->erreurmsg();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($avis->nberreur()==5){
|
||||
$avis->mailerreur();
|
||||
}
|
||||
$avis->erreurcpt('plus');
|
||||
echo $avis->erreurmsg();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,32 +209,22 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
|
||||
// --- Logging
|
||||
if ( array_key_exists('log', $methodConfig) ) {
|
||||
// --- Envoi email de contexte
|
||||
if( $methodConfig['log'] == 'mail' && in_array(APPLICATION_ENV, array('production', 'staging')) ) {
|
||||
$message = '';
|
||||
$message.= 'Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring;
|
||||
$message.= ' - Utilisateur : '.$this->getHttpLogin();
|
||||
$message = '';
|
||||
$message.= 'Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring;
|
||||
$message.= ' - Utilisateur : '.$this->getHttpLogin();
|
||||
$message.= "\n\n";
|
||||
$message.= "Method : ".$name.", File :".$fault->getFile().", Ligne : ".$fault->getLine();
|
||||
$message.= "\n\n";
|
||||
$message.= "Detail :\n".$fault->getTraceAsString();
|
||||
$message.= "\n\n";
|
||||
if ( $controller = Zend_Controller_Front::getInstance() ) {
|
||||
$message.= "Request Parameters :\n ".print_r($controller->getRequest()->getParams(), true);
|
||||
$message.= "\n\n";
|
||||
$message.= "Method : ".$name.", File :".$fault->getFile().", Ligne : ".$fault->getLine();
|
||||
$message.= "\n\n";
|
||||
$message.= "Detail :\n".$fault->getTraceAsString();
|
||||
$message.= "\n\n";
|
||||
if ( $controller = Zend_Controller_Front::getInstance() ) {
|
||||
$message.= "Request Parameters :\n ".print_r($controller->getRequest()->getParams(), true);
|
||||
$message.= "\n\n";
|
||||
}
|
||||
$message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n\n";
|
||||
$message.= "Requete :\n ".$requete."\n";
|
||||
$message.= "Reponse :\n ".$reponse."\n";
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd'));
|
||||
$mail->setBodyTextC($message);
|
||||
$mail->setFromKey('contact');
|
||||
$mail->addToKey('supportdev');
|
||||
$mail->execute();
|
||||
}
|
||||
$message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n\n";
|
||||
$message.= "Requete :\n ".$name."\n Arguments : ".$arguments."\n";
|
||||
$message.= "Reponse :\n ".$response."\n";
|
||||
$this->logger->error($message);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -750,7 +750,7 @@ class WsScores
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->type = $type;
|
||||
$params->groupe = $groupes;
|
||||
$params->groupe = $groupe;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getLienDoc($params);
|
||||
@ -3358,13 +3358,7 @@ class WsScores
|
||||
if (APPLICATION_ENV == 'development' ) {
|
||||
$this->logger->info('Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring);
|
||||
} else {
|
||||
$c = Zend_Registry::get('config');
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd'));
|
||||
$mail->setBodyTextC($message);
|
||||
$mail->setFromKey('support');
|
||||
$mail->addToKey('supportdev');
|
||||
$mail->execute();
|
||||
$this->logger->error($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user