<?php
/*
AjaxExplorer Copyright (C) 2007-2008 Syed Mohammad Sidque Tahir Al-Habshi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Head to
GNU site http://www.gnu.org/licenses/ for license copy.
*/
$access='0000';
include 'core.php';
$dirc=Post('dirc');
$list=array('/');
$size=0;
$tfls=0;
foreach(explode(':', Post('file')) as $id=>$file)
{
if(($id==0 || $file) && file_exists($dirs=$root.$dirc.$file))
{
if(!$id) $info=fileowner($dirs).':'.filegroup($dirs).':'.substr(sprintf('%o', fileperms($dirs)), -3);
if(is_dir($dirs))
{
for($i=0; $i<count($list); $i++)
{
if($dir=opendir($dirs.$list[$i]))
{
while($file=readdir($dir))
{
if($file!='.' && $file!='..')
{
if(!is_dir($dirs.$list[$i].$file))
{
$tfls++;
$size+=filesize($dirs.$list[$i].$file);
}
else $list[]=$list[$i].$file.'/';
}
}
closedir($dir);
}
}
} else {
$tfls++;
$size+=filesize($dirs);
}
}
}
echo $info.':'.$tfls.':'.(count($list)-1).':'.$size;
?>