From b136bd85c05740cd97d9dc44f1c8208110ac81cc Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 18 May 2011 10:05:53 +0000 Subject: [PATCH] Gestion du login utilisateur --- library/Infogreffe/Infogreffe.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/library/Infogreffe/Infogreffe.php b/library/Infogreffe/Infogreffe.php index 317e2e280..75a0ed13a 100644 --- a/library/Infogreffe/Infogreffe.php +++ b/library/Infogreffe/Infogreffe.php @@ -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");