Debug ".$path."
";
}
// ===============================================
foreach($_POST['deleteconfirm'] as $key=>$delfile){
// check for delete.
if (isset($_POST['selectedfile'][$key]) && isset($_POST['deletefiles'])) {
if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
exit;
}
$destination_file = e_BASE.$delfile;
if (@unlink($destination_file)) {
$message .= FMLAN_26." '".$destination_file."' ".FMLAN_27.".
";
} else {
$message .= FMLAN_28." '".$destination_file."'.
";
}
}
// check for move to downloads or downloadimages.
if (isset($_POST['selectedfile'][$key]) && (isset($_POST['movetodls'])) ){
$newfile = str_replace($path,"",$delfile);
// Move file to whatever folder.
if (isset($_POST['movetodls'])){
$newpath = $_POST['movepath'];
if (rename(e_BASE.$delfile,$newpath.$newfile)){
$message .= FMLAN_38." ".$newpath.$newfile."
";
} else {
$message .= FMLAN_39." ".$newpath.$newfile."
";
$message .= (!is_writable($newpath)) ? $newpath.LAN_NOTWRITABLE : "";
}
}
}
}
if (isset($_POST['upload'])) {
if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
exit;
}
$pref['upload_storagetype'] = "1";
require_once(e_HANDLER."upload_handler.php");
$files = $_FILES['file_userfile'];
foreach($files['name'] as $key => $name) {
if ($files['size'][$key]) {
$uploaded = file_upload(e_BASE.$_POST['upload_dir'][$key]);
}
}
}
if (isset($message)) {
$ns->tablerender("", "
".$message."
");
}
if (strpos(e_QUERY, ".")) {
echo "
";
if (!strpos(e_QUERY, "/")) {
$path = "";
} else {
$path = substr($path, 0, strrpos(substr($path, 0, -1), "/"))."/";
}
}
$files = array();
$dirs = array();
$path = explode("?", $path);
$path = $path[0];
$path = explode(".. ", $path);
$path = $path[0];
if ($handle = opendir(e_BASE.$path)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (getenv('windir') && is_file(e_BASE.$path."\\".$file)) {
if (is_file(e_BASE.$path."\\".$file)) {
$files[] = $file;
} else {
$dirs[] = $file;
}
} else {
if (is_file(e_BASE.$path."/".$file)) {
$files[] = $file;
} else {
$dirs[] = $file;
}
}
}
}
}
closedir($handle);
if (count($files) != 0) {
sort($files);
}
if (count($dirs) != 0) {
sort($dirs);
}
if (count($files) == 1) {
$cstr = FMLAN_12;
} else {
$cstr = FMLAN_13;
}
if (count($dirs) == 1) {
$dstr = FMLAN_14;
} else {
$dstr = FMLAN_15;
}
$pathd = $path;
$text = "";
$ns->tablerender(FMLAN_34, $text);
$text = "";
$ns->tablerender(FMLAN_29.": root/".$pathd." [ ".count($dirs)." ".$dstr.", ".count($files)." ".$cstr." ]", $text);
function dirsize($dir) {
$_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir;
$dh = @opendir($_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir);
$size = 0;
while ($file = @readdir($dh)) {
if ($file != "." and $file != "..") {
$path = $dir."/".$file;
if (is_file($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path)) {
$size += filesize($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path);
} else {
$size += dirsize($path."/");
}
}
}
@closedir($dh);
return parsesize($size);
}
function parsesize($size) {
$kb = 1024;
$mb = 1024 * $kb;
$gb = 1024 * $mb;
$tb = 1024 * $gb;
if ($size < $kb) {
return $size." b";
}
else if($size < $mb) {
return round($size/$kb, 2)." kb";
}
else if($size < $gb) {
return round($size/$mb, 2)." mb";
}
else if($size < $tb) {
return round($size/$gb, 2)." gb";
} else {
return round($size/$tb, 2)." tb";
}
}
require_once("footer.php");
?>