issue #0000533, getLogsClients - à tester sous linux

This commit is contained in:
Michael RICOIS 2011-02-01 13:48:46 +00:00
parent 8fd7b14d3a
commit d27aa9cfba

View File

@ -2894,7 +2894,7 @@ class WsInterne extends WsScore
/**
* getLogsClients
* @param string $mois
* @param string $mois (Format : AAAA-MM ou AAAA/MM)
* @param int $detail
* @param int $idClient
* @param string $login
@ -2907,12 +2907,15 @@ class WsInterne extends WsScore
//Initialisation
$error = new ErrorType();
if (empty($detail)) $detail = 0;
if (empty($idClient)) $idClient = 0;
if (empty($login)) $login = '';
if (empty($all)) $all = 0;
$strDetail = $strClient = $strLogin='';
// Vue détaillée ou uniquement les infos payantes
if ($detail==0)
{
if ($detail==0) {
$detail='Non';
//$strDetail=" AND (page LIKE 'greffe_%' OR page LIKE 'inpi_%' OR page='kbis' OR page='indiscore' ) AND (params<>'' OR page='indiscore' AND tarifIndiscore<>0) AND (params NOT LIKE '%erreur%' OR params LIKE '%erreur 17%') ";
$strDetail=" AND (page LIKE 'greffe_%' OR page LIKE 'inpi_%' OR page='kbis' OR page LIKE 'indiscore%' OR page='privileges' OR page='commandeAsso') AND (params<>'' OR page LIKE 'indiscore%' AND tarifIndiscore<>0) AND (params NOT LIKE '%erreur%' OR params LIKE '%erreur 17%') ";
@ -2926,8 +2929,10 @@ class WsInterne extends WsScore
} else {
$all = 'Non';
// Pas d'idClient mentionné ou tentative sur autre client et non SAD
if ($idClient*1==0 || ($idClient*1<>$this->tabInfoUser['idClient'] &&
if ($idClient==0
|| ($idClient*1<>$this->tabInfoUser['idClient'] &&
$this->tabInfoUser['profil']<>'SuperAdministrateur') ){
$idClient = $this->tabInfoUser['idClient'];
}
$strClient = " AND u.idClient=$idClient ";
@ -2938,7 +2943,7 @@ class WsInterne extends WsScore
else $login='Non';
// Dates de début et de fin
$mois=strtr($mois, array('-'=>'','/'=>''))*1;
$mois = strtr($mois, array('-'=>'','/'=>''));
$annee = substr($mois,0,4);
$mois = substr($mois,4,2);
$dateDeb=date('Y-m-d', mktime(0,0,0,$mois,1,$annee));
@ -2963,7 +2968,7 @@ class WsInterne extends WsScore
$fp = fopen(DOC_WEB_LOCAL."/csv/logs-$annee-$mois-$detail-$idClient-$login-$all.sql", 'w');
fwrite($fp, $sql.EOL);
fclose($fp);
exec(APPLICATION_PATH."/batch/sql2csv.php sdv1 ".DOC_WEB_LOCAL."/csv/logs-$annee-$mois-$detail-$idClient-$login-$all.sql $fichierCsv > /dev/null &");
exec(APPLICATION_PATH."/../batch/sql2csv.php sdv1 ".DOC_WEB_LOCAL."/csv/logs-$annee-$mois-$detail-$idClient-$login-$all.sql $fichierCsv > /dev/null &");
$size = $cache = 0;
}