Example #1
0
/**
 * FUNCTIONS.
 */
function read_directory($dir1 = null, $min_depth = 25, $htaccessfh = null)
{
    global $htaccessfh;
    if (!is_string($dir1)) {
        return false;
    }
    $depth = explode('/', $dir1);
    $current_depth = sizeof($depth);
    if ($current_depth < $min_depth) {
        $min_depth = $current_depth;
    }
    $dir = $dir1;
    $dh = opendir($dir);
    while ($file = readdir($dh)) {
        if ($file != '.' && $file != '..') {
            $file = $dir . '/' . $file;
            for ($i = 0; $i <= $current_depth - $min_depth; ++$i) {
                // $file is sub-directory
                if ($ddh = @opendir($file)) {
                    read_directory($file);
                } else {
                    if (strtolower($file) == '.htaccess') {
                        parseHtaccess($file);
                    }
                }
            }
        }
    }
    closedir($dh);
    return true;
}
Example #2
0
?>
<div id="debug" style="position: absolute; width: 200px; top:0px; left: 0px;"></div><table width="100%" cellpadding="0" cellspacing="0" border="0">
 <tr>
  <td class="main" bgcolor="#c3d9ff" valign="middle"><?
  
  if(empty($_GET['p'])) $page=0;
  else $page=intval($_GET['p']);
  
  $per = LIGHT_PERPAGE; // per page
  
  $mypage = ceil($page / $per) + 1;
  $res=read_directory(true,array(
  	'pagemin' => $mypage,
  	'pagemax' => $mypage,
  	'filt'    => $_GET['filter'],
  	'sort'    => $_GET['sort']?$_GET['sort']:'name',
  	'order'   => $_GET['order'],
  ));
  
  $pg = ''; // pages html
  
  $files = $dirs = array();
  
  if($res)
  {
  	  $pages = $res['pages_num'];
	  if($pages>1)
	  {
	  	$pg.='<div align="center">page: ';
	
Example #3
0
$fz=array(); /* filez :) */
$f=false;

if(!empty($_REQUEST['file'])) $fz[]=$f=clean($_REQUEST['file']);
if(!empty($_REQUEST['fullpath'])) $fz[]=$f=clean($_REQUEST['fullpath']);
if(!empty($_REQUEST['items']))
{
	foreach($_REQUEST['items'] as $v) $fz[]=clean($v/*['fullpath']*/);
	$f=$fz[0];
}

switch(@$_REQUEST['act'])
{
case 'filelist':
	$res = read_directory();
	$first_files = explode("/", substr($res['res'], 0, 20000));
	if (count($first_files)) array_pop($first_files);
	
	$_RESULT = array(
		'res'        => $res ? $res['res'] : false,
		'count'      => $res ? $res['cnt'] : false,
		'fileinfo'   => get_files_info($first_files),
		'DIR'        => $_SESSION['DIR'],
		'stats'      => stats(false),
		'info'       => get_info($_SESSION['DIR']),
		'type'       => (!empty($req['type']) && empty($drives) ? $req['type'] : (empty($drives) ? tDIR : tMYCOMP)),
		'up'         => $res ? $res['up'] : false,
		'reason'     => reason(),
        'error'      => !$res,
	);