authenticate sur la fonction setLog

This commit is contained in:
Michael RICOIS 2012-01-24 14:09:35 +00:00
parent c67c79c78e
commit b7d2695d50

View File

@ -1202,6 +1202,8 @@ class Interne extends WsScore
*/
public function setLog($page, $siret, $id=0, $ref='')
{
$this->authenticate();
//Initialisation
if (empty($id)) $id = 0;
if (empty($ref)) $ref = '';
@ -2437,9 +2439,25 @@ class Interne extends WsScore
$reponse = new RechercheHistoReponses();
$reponse->id = $etab['id'];
$reponse->Pertinence = $etab['Pertinence'];
$reponse->Fichier = strtr($etab['Fichier'],
array( '.txt'=>'.pdf', '/mnt/bodacc/' => 'http://tville.scores-decisions.com/bodacc/')
);
//@todo : gestion du lien pour le téléchargement des fichiers bodacc
$file = strtr($etab['Fichier'], array(
'.txt'=>'.pdf',
'/mnt/bodacc/' => ''));
$vieuxWS = true;
if ($vieuxWS) {
$reponse->Fichier = 'http://tville.scores-decisions.com/bodacc/'.$file;
} else {
$hostname = 'http://'.$_SERVER['SERVER_NAME'];
if ($_SERVER['SERVER_PORT']!='80'){
$hostname.= ':'.$_SERVER['SERVER_PORT'];
}
$reponse->Fichier = $hostname.'/'.$this->url(array(
'controller' => 'fichier',
'action' => 'bodacc',
'json' => json_encode(array('fichier'=>$file))
));
}
$reponse->Annee = $etab['Annee'];
$reponse->Code = $etab['Code'];
$reponse->Texte = utf8_encode(utf8_decode($texte2));