PASSWORD not configured!
"; if(!$cfg_basedir) $message .= "BASE DIRECTORY not configured!
"; $cfg_basedir = realpath($cfg_basedir); if($message) { $logged_in = false; unset($_REQUEST['login']); } if($_REQUEST['login'] && !$logged_in) $message = "Invalid password!"; if($logged_in) { if($_REQUEST["download"] != '') { $path = $_REQUEST["download"]; if(substr($path, 0, strlen($cfg_basedir)) == $cfg_basedir && file_exists($path) && (filetype($path) == 'file' || filetype($path) == 'dir')) download_file($path); else $message= "Invalid download: $path, exists: " . file_exists($path); } $dir = realpath($_REQUEST['dir']); if(!$dir || (substr($dir, 0, strlen($cfg_basedir)) != $cfg_basedir)) $dir = $cfg_basedir; } //========================================================================= // download_file: // Tar, gzip and download specified path //========================================================================= function download_file($path) { header("Content-type: application/x-gzip"); header("Content-Disposition: attachment; filename=" . basename($path) . ".tgz"); $dir = dirname($path); $file = basename($path); passthru("tar -zcf - -C '$dir' '$file'"); exit; } //========================================================================= // file_cmp: // Compare to files based on type and name (case insensitive) //========================================================================= function file_cmp($a, $b) { // Compare by file type (dir < file) $cmp = strcmp($a['type'], $b['type']); if($cmp) return $cmp; // Compare case-insensitive $cmp = strcasecmp($a['name'], $b['name']); if($cmp) return $cmp; // Compare case-sensitive $cmp = strcmp($a['name'], $b['name']); if($cmp) return $cmp; return 0; } //========================================================================= // read_directory: // Return contents of directory as array of file descriptors //========================================================================= function read_directory($dir) { $files = array(); if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { $path = "$dir/$file"; $type = filetype($path); $size = ($type == 'file') ? $size = filesize($path) . ' bytes' : ''; $files[] = array('name' => $file, 'type' => $type, 'size' => $size, 'path' => $path); } closedir($dh); } } usort($files, 'file_cmp'); return $files; } ?> Downloaded torrents: <?=$dir?>

Downloaded Torrents

Log out
" . dirname($cfg_basedir); $path = dirname($cfg_basedir); $count = 0; foreach($trail as $segment) { $path .= "$segment"; if(++$count < count($trail)) print "$segment/"; else print "$segment"; $path .= "/"; } print ""; ?>
$file)"; echo << LINE; } else { $name = $file; echo << LINE; } } ?>
Directories
Current directory ($file)Download
$nameDownload
LINE; } ?>
Files
$name$sizeDownload
Password: