Cette classe gère les logs utilisasteurs *

* Copyleft {@link http://alternc.net/ AlternC Team} * * @copyright AlternC-Team 2002-11-01 http://alternc.net/ */ class m_log { function m_log(){ } function list_logs_directory($dir){ global $cuid,$err; $err->log("log","list_logs_directory"); $c=array(); $dir2=$dir; if ($dir = @opendir($dir)) { while (($file = readdir($dir)) !== false) { if ($file!="." && $file!=".." && realpath($dir2 . "/" . $file) == $dir2 . "/" . $file){ $absfile=$dir2."/".$file; $c[]=array("name"=>$file, "creation_date"=>date("F d Y H:i:s.", filectime($absfile)), "filesize"=>filesize($absfile), "downlink"=>"logs_download.php?file=".urlencode($file), ); } } closedir($dir); } usort($c,"compare_logname"); return $c; }//list_logs function list_logs_directory_all($dirs){ global $err; $err->log("log","get_logs_directory_all"); $c=array(); foreach($dirs as $dir=>$val){ $c[$dir]=$this->list_logs_directory($val); } return $c; } function get_logs_directory(){ global $cuid,$mem,$err; $err->log("log","get_logs_directory"); $c=array("dir"=>ALTERNC_LOGS."/".$cuid."-".$mem->user["login"]); return $c; } function download_link($file){ global $err,$mem; $err->log("log","download_link"); header("Content-Disposition: attachment; filename=$file"); header("Content-Type: application/force-download"); header("Content-Transfer-Encoding: binary"); $f=$this->get_logs_directory(); $ff=$f['dir']."/".basename($file); set_time_limit(0); readfile($ff); } } // end class