Gestion du login utilisateur

This commit is contained in:
Michael RICOIS 2011-05-18 10:05:53 +00:00
parent 09fdc7fa52
commit b136bd85c0

View File

@ -193,6 +193,8 @@ class Infogreffe
protected $pathCacheXML = '';
protected $pathData = '';
protected $login = '';
public function __construct()
{
$config = parse_ini_file(realpath(dirname(__FILE__)).'/config.ini', true);
@ -216,6 +218,10 @@ class Infogreffe
}
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'path');
$this->pathData = realpath($config->data);
require_once 'Scores/Utilisateur.php';
$user = new Utilisateur();
$this->login = $user->getLogin();
}
/**
@ -1191,7 +1197,12 @@ class Infogreffe
return $return;
}
function logfile($info){
/**
* logfile
* @param unknown_type $info
*/
function logfile($info)
{
$file = $this->pathData.'/log/infogreffe-'.date('Ym').'.log';
if( !file_exists($file) ){
$entetes = array('date', 'login', 'siren', 'idCommande', 'type', 'vecteur', 'option');
@ -1199,7 +1210,7 @@ class Infogreffe
fputcsv($fp, $entetes, "\t");
fclose($fp);
}
$preinfo = array(date('Y-m-d H:i:s'), $_SESSION['tabInfo']['login']);
$preinfo = array(date('Y-m-d H:i:s'), $this->login);
$result = array_merge($preinfo, $info);
$fp = fopen($file, 'a');
fputcsv($fp, $result, "\t");