Debug ".$path."
"; } // =============================================== if (isset($_POST['deleteconfirm'])) { $deleteList = array(); $moveList = array(); 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.".
"; $deleteList[] = $destination_file; } 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."
"; $moveList[] = e_BASE.$delfile.'=>'.$newpath.$newfile; } else { $message .= FMLAN_39." ".$newpath.$newfile."
"; $message .= (!is_writable($newpath)) ? $newpath.LAN_NOTWRITABLE : ""; } } } } if (count($deleteList)) { $admin_log->log_event('FILEMAN_01',implode('[!br!]',$deleteList),E_LOG_INFORMATIVE,''); } if (count($moveList)) { $admin_log->log_event('FILEMAN_02',implode('[!br!]',$moveList),E_LOG_INFORMATIVE,''); } } if (isset($_POST['upload'])) { if (!$_POST['ac'] == md5(ADMINPWCHANGE)) { exit; } $uploadList = array(); $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]); $uploadList[] = $_POST['upload_dir'][$key].$uploaded[0]['name']; } } if (count($uploadList)) { $admin_log->log_event('FILEMAN_03',implode('[!br!]',$uploadList),E_LOG_INFORMATIVE,''); } } if (isset($message)) { $ns->tablerender("", "
".$message."
"); } if (strpos(e_QUERY, ".") && !is_dir(realpath(e_BASE.$path))) { 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 = "
".FMLAN_32."
"; // $ns->tablerender(FMLAN_34, $text); // Get largest allowable file upload $max_file_size = get_user_max_upload(); if ($path != e_FILE) { if (substr_count($path, "/") == 1) { //$pathup = e_SELF; $pathup = ''; } else { $pathup = "".FMLAN_30.""; } } $text .= "
XX "; $c = 0; while ($dirs[$c]) { $dirsize = dirsize($path.$dirs[$c]); $el_id = str_replace(array('/','_',' ','\\'),'-',$path.$dirs[$c]); if (FILE_UPLOADS && is_writable(e_BASE.$path.$dirs[$c])) { $up_button = $frm->admin_button('erquest', FMLAN_21, 'action', '', array('id'=>false, 'other'=>"onclick='e107Helper.toggle(\"{$el_id}\")'")); } else { $up_button = " leave_32.png"; } //FIXME - upload link not working, raplace with image $text .= " "; $c++; } $c = 0; while ($files[$c]) { $img = substr(strrchr($files[$c], "."), 1, 3); if (!$img || !preg_match("/css|exe|gif|htm|jpg|js|php|png|txt|xml|zip/i", $img)) { $img = "def"; } $size = $e107->parseMemorySize(filesize(e_BASE.$path."/".$files[$c])); $gen = new convert; $filedate = $gen -> convert_date(filemtime(e_BASE.$path."/".$files[$c]), "forum"); $text .= " "; $c++; } $text .= "
".$pathup." ".FMLAN_17." ".FMLAN_18." ".FMLAN_19."
upload ".$dirs[$c]." ".FMLAN_31." ".$dirs[$c]."
".$frm->file('file_userfile[]', array('id'=>false, 'size'=>'20')).$frm->admin_button('upload', FMLAN_22, '', '', array('id'=>false))."
".$dirsize."  
".$frm->checkbox("selectedfile[$c]", 1, false, array('id'=>false))." ".$files[$c]." ".$files[$c]." ".$size." ".$filedate."
".$frm->admin_button('check_all', 'jstarget:selectedfile', 'action', LAN_CHECKALL, array('id'=>false))." ".$frm->admin_button('uncheck_all', 'jstarget:selectedfile', 'action', LAN_UNCHECKALL, array('id'=>false))." "; if ($pubfolder || e_QUERY == ""){ require_once(e_HANDLER."file_class.php"); $fl = new e_file; $dl_dirlist = $fl->get_dirs(e_DOWNLOAD); $movechoice = array(); $movechoice[] = e_DOWNLOAD; foreach($dl_dirlist as $dirs){ $movechoice[] = e_DOWNLOAD.$dirs."/"; } sort($movechoice); $movechoice[] = e_FILE."downloadimages/"; if(e_QUERY != str_replace("../","",e_UPLOAD)){ $movechoice[] = e_UPLOAD; } if(e_QUERY != str_replace("../","",e_FILE."downloadthumbs/")){ $movechoice[] = e_FILE."downloadthumbs/"; } if(e_QUERY != str_replace("../","",e_FILE."misc/")){ $movechoice[] = e_FILE."misc/"; } if(e_QUERY != str_replace("../","",e_IMAGE)){ $movechoice[] = e_IMAGE; } if(e_QUERY != str_replace("../","",e_IMAGE."newspost_images/")){ $movechoice[] = e_IMAGE."newspost_images/"; } //FIXME - form elements $text .= FMLAN_48." ".$frm->admin_button('movetodls', FMLAN_50, 'move', '', array('other' => "onclick=\"return e107Helper.confirm('".$tp->toJS(FMLAN_49)."') \"")); } $text .= " ".$frm->admin_button('deletefiles', FMLAN_43, 'delete', '', array('title' => $tp->toJS(FMLAN_46)))."
"; $ns->tablerender(FMLAN_29.": root/".$pathd."  [ ".count($dirs)." ".$dstr.", ".count($files)." ".$cstr." ]", $text); function dirsize($dir) { global $e107; $_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 $e107->parseMemorySize($size); } require_once("footer.php"); /** * Handle page DOM within the page header * * @return string JS source */ function headerjs() { require_once(e_HANDLER.'js_helper.php'); $ret = " "; return $ret; } ?>