Correction indentation

This commit is contained in:
Alan Garcia 2012-08-23 07:36:11 +00:00
parent c90d5747f7
commit 7b3e26cff5
1 changed files with 39 additions and 39 deletions

View File

@ -32,68 +32,68 @@
class m_log { class m_log {
function m_log(){ function m_log(){
} }
function list_logs_directory($dir){ function list_logs_directory($dir){
global $cuid,$err; global $cuid,$err;
$err->log("log","list_logs_directory"); $err->log("log","list_logs_directory");
$dir2=$dir; $dir2=$dir;
if ($dir = @opendir($dir)) { if ($dir = @opendir($dir)) {
while (($file = readdir($dir)) !== false) { while (($file = readdir($dir)) !== false) {
if ($file!="." && $file!=".." && realpath($dir2 . "/" . $file) == $dir2 . "/" . $file){ if ($file!="." && $file!=".." && realpath($dir2 . "/" . $file) == $dir2 . "/" . $file){
$absfile=$dir2."/".$file; $absfile=$dir2."/".$file;
$c[]=array("name"=>$file, $c[]=array("name"=>$file,
"creation_date"=>date("F d Y H:i:s.", filectime($absfile)), "creation_date"=>date("F d Y H:i:s.", filectime($absfile)),
"filesize"=>filesize($absfile), "filesize"=>filesize($absfile),
"downlink"=>"logs_download.php?file=".urlencode($file), "downlink"=>"logs_download.php?file=".urlencode($file),
); );
} }
} }
closedir($dir); closedir($dir);
} }
usort($c,"compare_logname"); usort($c,"compare_logname");
return $c; return $c;
}//list_logs }//list_logs
function list_logs_directory_all($dirs){ function list_logs_directory_all($dirs){
global $err; global $err;
$err->log("log","get_logs_directory_all"); $err->log("log","get_logs_directory_all");
$c=array(); $c=array();
foreach($dirs as $dir=>$val){ foreach($dirs as $dir=>$val){
$c[$dir]=$this->list_logs_directory($val); $c[$dir]=$this->list_logs_directory($val);
} }
return $c; return $c;
} }
function get_logs_directory(){ function get_logs_directory(){
global $cuid,$db,$err; global $cuid,$db,$err;
$err->log("log","get_logs_directory"); $err->log("log","get_logs_directory");
$db->query("select login from membres where uid=$cuid ;"); $db->query("select login from membres where uid=$cuid ;");
if ($db->num_rows()==0) { if ($db->num_rows()==0) {
$err->raise("log",1); $err->raise("log",1);
return false; return false;
} }
$db->next_record(); $db->next_record();
$c=array("dir"=>"/var/alternc/logs/".$cuid."-".$db->f("login")); $c=array("dir"=>"/var/alternc/logs/".$cuid."-".$db->f("login"));
return $c; return $c;
} }
function download_link($file){ function download_link($file){
global $err,$mem; global $err,$mem;
$err->log("log","download_link"); $err->log("log","download_link");
header("Content-Disposition: attachment; filename=".$mem->user["login"].".zip"); header("Content-Disposition: attachment; filename=".$mem->user["login"].".zip");
header("Content-Type: application/force-download"); header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
$f=$this->get_logs_directory(); $f=$this->get_logs_directory();
$ff=$f['dir']."/".basename($file); $ff=$f['dir']."/".basename($file);
set_time_limit(0); set_time_limit(0);
readfile($ff); readfile($ff);
} }
} // end class } // end class