$val) $$key=htmldecode($val); foreach ($_POST as $key => $val) $$key=htmldecode($val); foreach ($_COOKIE as $key => $val) $$key=htmldecode($val); if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) $ip = $_SERVER["REMOTE_ADDR"]; //nao usa proxy else $ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; //usa proxy $islinux = !(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); $url_info = parse_url($_SERVER["HTTP_REFERER"]); $doc_root = ($islinux) ? $_SERVER["DOCUMENT_ROOT"] : ucfirst($_SERVER["DOCUMENT_ROOT"]); $script_filename = $doc_root.$_SERVER["PHP_SELF"]; $path_info = pathinfo($script_filename); // +-------------------------------------------------- // | Config // +-------------------------------------------------- $cfg = new config(); $cfg->load(); ini_set("display_errors",1); ini_set("error_reporting",$error_reporting); if (!isset($dir_atual)){ $dir_atual = $path_info["dirname"]."/"; if (!$islinux) $dir_atual = ucfirst($dir_atual); @chmod($dir_atual,0777); } else $dir_atual = formatpath($dir_atual); $is_reachable = (stristr($dir_atual,$doc_root)!==false); // Auto Expand Local Path if (!isset($expanded_dir_list)){ $expanded_dir_list = ""; $mat = explode("/",$path_info["dirname"]); for ($x=0;$x$color){ $fm_color[$tag]=strtolower($color); } // +-------------------------------------------------- // | File Manager Actions // +-------------------------------------------------- if ($loggedon==$auth_pass){ switch ($frame){ case 1: break; // Empty Frame case 2: frame2(); break; case 3: frame3(); break; default: switch($action){ case 1: logout(); break; case 2: config_form(); break; case 3: download(); break; case 4: view(); break; case 5: server_info(); break; case 6: execute(); break; case 7: edit_file_form(); break; case 8: chmod_form(); break; case 9: shell_form(); break; case 10: upload_form(); break; default: frameset(); } } } else { if (isset($senha)) login(); else form_login(); } // +-------------------------------------------------- // | Config Class // +-------------------------------------------------- class config { var $data; var $filename; function config(){ global $script_filename; $this->data = array( 'lang'=>'en', 'auth_pass'=>md5(''), 'quota_mb'=>0, 'upload_ext_filter'=>array(), 'download_ext_filter'=>array(), 'error_reporting'=>'', 'fm_root'=>'', 'cookie_cache_time'=>time()+60*60*24*30, // 30 Dias 'version'=>'0.9.3' ); $data = false; $this->filename = $script_filename; if (file_exists($this->filename)){ $mat = file($this->filename); $objdata = trim(substr($mat[1],2)); if (strlen($objdata)) $data = unserialize($objdata); } if (is_array($data)&&count($data)==count($this->data)) $this->data = $data; else $this->save(); } function save(){ $objdata = "data).chr(13).chr(10); if (strlen($objdata)){ if (file_exists($this->filename)){ $mat = file($this->filename); if ($fh = @fopen($this->filename, "w")){ @fputs($fh,$objdata,strlen($objdata)); for ($x=2;$xdata as $key => $val) $GLOBALS[$key] = $val; } } // +-------------------------------------------------- // | Internationalization // +-------------------------------------------------- function et($tag){ global $lang; // English $en['Version'] = 'Version'; $en['DocRoot'] = 'Document Root'; $en['FLRoot'] = 'File Manager Root'; $en['Name'] = 'Name'; $en['And'] = 'and'; $en['Enter'] = 'Enter'; $en['Send'] = 'Send'; $en['Refresh'] = 'Refresh'; $en['SaveConfig'] = 'Save Configurations'; $en['SavePass'] = 'Save Password'; $en['SaveFile'] = 'Save File'; $en['Save'] = 'Save'; $en['Leave'] = 'Leave'; $en['Edit'] = 'Edit'; $en['View'] = 'View'; $en['Config'] = 'Config'; $en['Ren'] = 'Rename'; $en['Rem'] = 'Delete'; $en['Compress'] = 'Compress'; $en['Decompress'] = 'Decompress'; $en['ResolveIDs'] = 'Resolve IDs'; $en['Move'] = 'Move'; $en['Copy'] = 'Copy'; $en['ServerInfo'] = 'Server Info'; $en['CreateDir'] = 'Create Directory'; $en['CreateArq'] = 'Create File'; $en['ExecCmd'] = 'Execute Command'; $en['Upload'] = 'Upload'; $en['UploadEnd'] = 'Upload Finished'; $en['Perms'] = 'Permissions'; $en['Owner'] = 'Owner'; $en['Group'] = 'Group'; $en['Other'] = 'Other'; $en['Size'] = 'Size'; $en['Date'] = 'Date'; $en['Type'] = 'Type'; $en['Free'] = 'free'; $en['Shell'] = 'Shell'; $en['Read'] = 'Read'; $en['Write'] = 'Write'; $en['Exec'] = 'Execute'; $en['Apply'] = 'Apply'; $en['StickyBit'] = 'Sticky Bit'; $en['Pass'] = 'Password'; $en['Lang'] = 'Language'; $en['File'] = 'File'; $en['File_s'] = 'file(s)'; $en['Dir_s'] = 'directory(s)'; $en['To'] = 'to'; $en['Destination'] = 'Destination'; $en['Configurations'] = 'Configurations'; $en['JSError'] = 'JavaScript Error'; $en['NoSel'] = 'There are no selected itens'; $en['SelDir'] = 'Select the destination directory on the left tree'; $en['TypeDir'] = 'Enter the directory name'; $en['TypeArq'] = 'Enter the file name'; $en['TypeCmd'] = 'Enter the command'; $en['TypeArqComp'] = 'Enter the file name.\\nThe extension will define the compression type.\\nEx:\\nnome.zip\\nnome.tar\\nnome.bzip\\nnome.gzip'; $en['RemSel'] = 'DELETE selected itens'; $en['NoDestDir'] = 'There is no selected destination directory'; $en['DestEqOrig'] = 'Origin and destination directories are equal'; $en['InvalidDest'] = 'Destination directory is invalid'; $en['NoNewPerm'] = 'New permission not set'; $en['CopyTo'] = 'COPY to'; $en['MoveTo'] = 'MOVE to'; $en['AlterPermTo'] = 'CHANGE PERMISSIONS to'; $en['ConfExec'] = 'Confirm EXECUTE'; $en['ConfRem'] = 'Confirm DELETE'; $en['EmptyDir'] = 'Empty directory'; $en['IOError'] = 'I/O Error'; $en['FileMan'] = 'PHP File Manager'; $en['TypePass'] = 'Enter the password'; $en['InvPass'] = 'Invalid Password'; $en['ReadDenied'] = 'Read Access Denied'; $en['FileNotFound'] = 'File not found'; $en['AutoClose'] = 'Close on Complete'; $en['OutDocRoot'] = 'File beyond DOCUMENT_ROOT'; $en['NoCmd'] = 'Error: Command not informed'; $en['ConfTrySave'] = 'File without write permisson.\\nTry to save anyway'; $en['ConfSaved'] = 'Configurations saved'; $en['PassSaved'] = 'Password saved'; $en['FileDirExists'] = 'File or directory already exists'; $en['NoPhpinfo'] = 'Function phpinfo disabled'; $en['NoReturn'] = 'no return'; $en['FileSent'] = 'File sent'; $en['SpaceLimReached'] = 'Space limit reached'; $en['InvExt'] = 'Invalid extension'; $en['FileNoOverw'] = 'File could not be overwritten'; $en['FileOverw'] = 'File overwritten'; $en['FileIgnored'] = 'File ignored'; $en['ChkVer'] = 'Check sf.net for new version'; $en['ChkVerAvailable'] = 'New version, click here to begin download!!'; $en['ChkVerNotAvailable'] = 'No new version available. :('; $en['ChkVerError'] = 'Connection Error.'; $en['Website'] = 'Website'; $en['SendingForm'] = 'Sending files, please wait'; $en['NoFileSel'] = 'No file selected'; $en['SelAll'] = 'All'; $en['SelNone'] = 'None'; $en['SelInverse'] = 'Inverse'; $en['Selected_s'] = 'selected'; $en['Total'] = 'total'; $en['Partition'] = 'Partition'; $en['RenderTime'] = 'Time to render this page'; $en['Seconds'] = 'sec'; $en['ErrorReport'] = 'Error Reporting'; // Portuguese $pt['Version'] = 'Versão'; $pt['DocRoot'] = 'Document Root'; $pt['FLRoot'] = 'File Manager Root'; $pt['Name'] = 'Nome'; $pt['And'] = 'e'; $pt['Enter'] = 'Entrar'; $pt['Send'] = 'Enviar'; $pt['Refresh'] = 'Atualizar'; $pt['SaveConfig'] = 'Salvar Configurações'; $pt['SavePass'] = 'Salvar Senha'; $pt['SaveFile'] = 'Salvar Arquivo'; $pt['Save'] = 'Salvar'; $pt['Leave'] = 'Sair'; $pt['Edit'] = 'Editar'; $pt['View'] = 'Visualizar'; $pt['Config'] = 'Config'; $pt['Ren'] = 'Renomear'; $pt['Rem'] = 'Apagar'; $pt['Compress'] = 'Compactar'; $pt['Decompress'] = 'Descompactar'; $pt['ResolveIDs'] = 'Resolver IDs'; $pt['Move'] = 'Mover'; $pt['Copy'] = 'Copiar'; $pt['ServerInfo'] = 'Server Info'; $pt['CreateDir'] = 'Criar Diretório'; $pt['CreateArq'] = 'Criar Arquivo'; $pt['ExecCmd'] = 'Executar Comando'; $pt['Upload'] = 'Upload'; $pt['UploadEnd'] = 'Upload Terminado'; $pt['Perms'] = 'Permissões'; $pt['Owner'] = 'Dono'; $pt['Group'] = 'Grupo'; $pt['Other'] = 'Outros'; $pt['Size'] = 'Tamanho'; $pt['Date'] = 'Data'; $pt['Type'] = 'Tipo'; $pt['Free'] = 'livre'; $pt['Shell'] = 'Shell'; $pt['Read'] = 'Ler'; $pt['Write'] = 'Escrever'; $pt['Exec'] = 'Executar'; $pt['Apply'] = 'Aplicar'; $pt['StickyBit'] = 'Sticky Bit'; $pt['Pass'] = 'Senha'; $pt['Lang'] = 'Idioma'; $pt['File'] = 'Arquivo'; $pt['File_s'] = 'arquivo(s)'; $pt['Dir_s'] = 'diretorio(s)'; $pt['To'] = 'para'; $pt['Destination'] = 'Destino'; $pt['Configurations'] = 'Configurações'; $pt['JSError'] = 'Erro de JavaScript'; $pt['NoSel'] = 'Não há itens selecionados'; $pt['SelDir'] = 'Selecione o diretório de destino na árvore a esquerda'; $pt['TypeDir'] = 'Digite o nome do diretório'; $pt['TypeArq'] = 'Digite o nome do arquivo'; $pt['TypeCmd'] = 'Digite o commando'; $pt['TypeArqComp'] = 'Digite o nome do arquivo.\\nA extensão determina o tipo de compactação.\\nEx:\\nnome.zip\\nnome.tar\\nnome.bzip\\nnome.gzip'; $pt['RemSel'] = 'APAGAR itens selecionados'; $pt['NoDestDir'] = 'Não há um diretório de destino selecionado'; $pt['DestEqOrig'] = 'Diretório de origem e destino iguais'; $pt['InvalidDest'] = 'Diretório de destino inválido'; $pt['NoNewPerm'] = 'Nova permissão não foi setada'; $pt['CopyTo'] = 'COPIAR para'; $pt['MoveTo'] = 'MOVER para'; $pt['AlterPermTo'] = 'ALTERAR PERMISSÕES para'; $pt['ConfExec'] = 'Confirma EXECUTAR'; $pt['ConfRem'] = 'Confirma APAGAR'; $pt['EmptyDir'] = 'Diretório vazio'; $pt['IOError'] = 'Erro de E/S'; $pt['FileMan'] = 'PHP File Manager'; $pt['TypePass'] = 'Digite a senha'; $pt['InvPass'] = 'Senha Inválida'; $pt['ReadDenied'] = 'Acesso de leitura negado'; $pt['FileNotFound'] = 'Arquivo não encontrado'; $pt['AutoClose'] = 'Fechar Automaticamente'; $pt['OutDocRoot'] = 'Arquivo fora do DOCUMENT_ROOT'; $pt['NoCmd'] = 'Erro: Comando não informado'; $pt['ConfTrySave'] = 'Arquivo sem permissão de escrita.\\nTentar salvar assim mesmo'; $pt['ConfSaved'] = 'Configurações salvas'; $pt['PassSaved'] = 'Senha salva'; $pt['FileDirExists'] = 'Arquivo ou diretório já existe'; $pt['NoPhpinfo'] = 'Função phpinfo desabilitada'; $pt['NoReturn'] = 'sem retorno'; $pt['FileSent'] = 'Arquivo enviado'; $pt['SpaceLimReached'] = 'Limite de espaço alcançado'; $pt['InvExt'] = 'Extensão inválida'; $pt['FileNoOverw'] = 'Arquivo não pode ser sobreescrito'; $pt['FileOverw'] = 'Arquivo sobreescrito'; $pt['FileIgnored'] = 'Arquivo omitido'; $pt['ChkVer'] = 'Verificar sf.net por nova versão'; $pt['ChkVerAvailable'] = 'Nova versão, clique aqui para iniciar download!!'; $pt['ChkVerNotAvailable'] = 'Não há nova versão disponível :('; $pt['ChkVerError'] = 'Erro de conexão.'; $pt['Website'] = 'Website'; $pt['SendingForm'] = 'Enviando arquivos, aguarde'; $pt['NoFileSel'] = 'Nenhum arquivo selecionado'; $pt['SelAll'] = 'Tudo'; $pt['SelNone'] = 'Nada'; $pt['SelInverse'] = 'Inverso'; $pt['Selected_s'] = 'selecionado(s)'; $pt['Total'] = 'total'; $pt['Partition'] = 'Partição'; $pt['RenderTime'] = 'Tempo para gerar esta página'; $pt['Seconds'] = 'seg'; $pt['ErrorReport'] = 'Error Reporting'; $lang_ = $$lang; if (isset($lang_[$tag])) return htmlencode($lang_[$tag]); else return "undefined"; } // +-------------------------------------------------- // | File System // +-------------------------------------------------- function total_size($arg) { $total = 0; if (file_exists($arg)) { if (is_dir($arg)) { $handle = opendir($arg); while($aux = readdir($handle)) { if ($aux != "." && $aux != "..") $total += total_size($arg."/".$aux); } closedir($handle); } else $total = filesize($arg); } return $total; } function total_delete($arg) { if (file_exists($arg)) { chmod($arg,0777); if (is_dir($arg)) { $handle = opendir($arg); while($aux = readdir($handle)) { if ($aux != "." && $aux != "..") total_delete($arg."/".$aux); } closedir($handle); rmdir($arg); } else unlink($arg); } } function total_copy($orig,$dest) { $ok = true; if (file_exists($orig)) { if (is_dir($orig)) { mkdir($dest,0777); $handle = opendir($orig); while(($aux = readdir($handle))&&($ok)) { if ($aux != "." && $aux != "..") $ok = total_copy($orig."/".$aux,$dest."/".$aux); } closedir($handle); } else $ok = copy((string)$orig,(string)$dest); } return $ok; } function total_move($orig,$dest) { // Just why doesn't it has a MOVE alias?! return rename((string)$orig,(string)$dest); } function download(){ global $dir_atual,$filename; $file = $dir_atual.$filename; if(file_exists($file)){ $is_proibido = false; foreach($download_ext_filter as $key=>$ext){ if (eregi($ext,$filename)){ $is_proibido = true; break; } } if (!$is_proibido){ $size = filesize($file); header("Content-Type: application/save"); header("Content-Length: $size"); header("Content-Disposition: attachment; filename=\"$filename\""); header("Content-Transfer-Encoding: binary"); if ($fh = fopen("$file", "rb")){ fpassthru($fh); fclose($fh); } else alert(et('ReadDenied').": ".$file); } else alert(et('ReadDenied').": ".$file); } else alert(et('FileNotFound').": ".$file); } function execute(){ global $cmd; header("Content-type: text/plain"); if (strlen($cmd)){ echo "# ".$cmd."\n"; exec($cmd,$mat); if (count($mat)) echo trim(implode("\n",$mat)); else echo "exec(\"$cmd\") ".et('NoReturn')."..."; } else echo et('NoCmd'); } function save_upload($temp_file,$filename,$dir_dest) { global $upload_ext_filter; $filename = remove_acentos($filename); $file = $dir_dest.$filename; $filesize = filesize($temp_file); $is_proibido = false; foreach($upload_ext_filter as $key=>$ext){ if (eregi($ext,$filename)){ $is_proibido = true; break; } } if (!$is_proibido){ if (!limite($filesize)){ if (file_exists($file)){ if (unlink($file)){ if (copy($temp_file,$file)){ chmod($file,0777); $out = 6; } else $out = 2; } else $out = 5; } else { if (copy($temp_file,$file)){ chmod($file,0777); $out = 1; } else $out = 2; } } else $out = 3; } else $out = 4; return $out; } function zip_extract(){ global $cmd_arg,$dir_atual,$islinux; $zip = zip_open($dir_atual.$cmd_arg); if ($zip) { while ($zip_entry = zip_read($zip)) { if (zip_entry_filesize($zip_entry)) { $complete_path = $path.dirname(zip_entry_name($zip_entry)); $complete_name = $path.zip_entry_name($zip_entry); if(!file_exists($complete_path)) { $tmp = ''; foreach(explode('/',$complete_path) AS $k) { $tmp .= $k.'/'; if(!file_exists($tmp)) { @mkdir($dir_atual.$tmp, 0777); } } } if (zip_entry_open($zip, $zip_entry, "r")) { if ($fd = fopen($dir_atual.$complete_name, 'w')){ fwrite($fd, zip_entry_read($zip_entry, zip_entry_filesize($zip_entry))); fclose($fd); } else echo "fopen($dir_atual.$complete_name) error
"; zip_entry_close($zip_entry); } else echo "zip_entry_open($zip,$zip_entry) error
"; } } zip_close($zip); } } // +-------------------------------------------------- // | Data Formating // +-------------------------------------------------- function htmlencode($str){ return htmlentities($str); } // html_entity_decode() replacement function html_entity_decode_for_php4_compatibility ($string) { $trans_tbl = get_html_translation_table (HTML_ENTITIES); $trans_tbl = array_flip ($trans_tbl); $ret = strtr ($string, $trans_tbl); return preg_replace('/\&\#([0-9]+)\;/me', "chr('\\1')",$ret); } function htmldecode($str){ if (is_string($str)){ if (get_magic_quotes_gpc()) return stripslashes(html_entity_decode_for_php4_compatibility($str)); else return html_entity_decode($str); } else return $str; } function rep($x,$y){ if ($x) { $aux = ""; for ($a=1;$a<=$x;$a++) $aux .= $y; return $aux; } else return ""; } function strzero($arg1,$arg2){ if (strstr($arg1,"-") == false){ $aux = intval($arg2) - strlen($arg1); if ($aux) return rep($aux,"0").$arg1; else return $arg1; } else { return "[$arg1]"; } } function replace_double($sub,$str){ $out=str_replace($sub.$sub,$sub,$str); while ( strlen($out) != strlen($str) ){ $str=$out; $out=str_replace($sub.$sub,$sub,$str); } return $out; } function remove_acentos($str){ $str = trim($str); $str = strtr($str,"¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ!@#%&*()[]{}+=?", "YuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy_______________"); $str = str_replace("..","",str_replace("/","",str_replace("\\","",str_replace("\$","",$str)))); return $str; } function formatpath($str){ global $islinux; $str = trim($str); $str = str_replace("..","",str_replace("\\","/",str_replace("\$","",$str))); $done = false; while (!$done) { $str2 = str_replace("//","/",$str); if (strlen($str) == strlen($str2)) $done = true; else $str = $str2; } $tam = strlen($str); if ($tam){ $last_char = $tam - 1; if ($str[$last_char] != "/") $str .= "/"; if (!$islinux) $str = ucfirst($str); } return $str; } function array_csort() { $args = func_get_args(); $marray = array_shift($args); $msortline = "return(array_multisort("; foreach ($args as $arg) { $i++; if (is_string($arg)) { foreach ($marray as $row) { $sortarr[$i][] = $row[$arg]; } } else { $sortarr[$i] = $arg; } $msortline .= "\$sortarr[".$i."],"; } $msortline .= "\$marray));"; eval($msortline); return $marray; } function show_perms( $in_Perms ) { $sP = ""; if($in_Perms & 0x1000) $sP .= 'p'; // FIFO pipe elseif($in_Perms & 0x2000) $sP .= 'c'; // Character special elseif($in_Perms & 0x4000) $sP .= 'd'; // Directory elseif($in_Perms & 0x6000) $sP .= 'b'; // Block special elseif($in_Perms & 0x8000) $sP .= '−'; // Regular elseif($in_Perms & 0xA000) $sP .= 'l'; // Symbolic Link elseif($in_Perms & 0xC000) $sP .= 's'; // Socket else $sP .= 'u'; // UNKNOWN $sP .= ""; // owner - group - others $sP .= (($in_Perms & 0x0100) ? 'r' : '−') . (($in_Perms & 0x0080) ? 'w' : '−') . (($in_Perms & 0x0040) ? (($in_Perms & 0x0800) ? 's' : 'x' ) : (($in_Perms & 0x0800) ? 'S' : '−')); $sP .= (($in_Perms & 0x0020) ? 'r' : '−') . (($in_Perms & 0x0010) ? 'w' : '−') . (($in_Perms & 0x0008) ? (($in_Perms & 0x0400) ? 's' : 'x' ) : (($in_Perms & 0x0400) ? 'S' : '−')); $sP .= (($in_Perms & 0x0004) ? 'r' : '−') . (($in_Perms & 0x0002) ? 'w' : '−') . (($in_Perms & 0x0001) ? (($in_Perms & 0x0200) ? 't' : 'x' ) : (($in_Perms & 0x0200) ? 'T' : '−')); return $sP; } function formatsize($arg) { if ($arg>0){ $j = 0; $ext = array(" bytes"," Kb"," Mb"," Gb"," Tb"); while ($arg >= pow(1024,$j)) ++$j; return round($arg / pow(1024,$j-1) * 100) / 100 . $ext[$j-1]; } else return "0 Mb"; } function getsize($file) { return formatsize(filesize($file)); } function limite($new_filesize=0) { global $fm_root_atual; global $quota_mb; if($quota_mb){ $total = total_size($fm_root_atual); if (floor(($total+$new_filesize)/(1024*1024)) > $quota_mb) return true; } return false; } function getuser ($arg) { global $mat_passwd; $aux = "x:".trim($arg).":"; for($x=0;$x ...:::: ".et('FileMan')." $plus "; } function reloadframe($ref,$frame_number,$plus=""){ global $dir_atual,$path_info; echo " "; } function alert($arg){ echo " "; } function tree($dir_antes,$dir_corrente,$indice){ global $fm_root_atual, $dir_atual, $islinux; global $expanded_dir_list; $indice++; $num_dir = 0; $dir_name = str_replace($dir_antes,"",$dir_corrente); $dir_corrente = str_replace("//","/",$dir_corrente); $is_proibido = false; if ($islinux) { $proibidos = "/proc#/dev"; $mat = explode("#",$proibidos); foreach($mat as $key => $val){ if ($dir_corrente == $val){ $is_proibido = true; break; } } unset($mat); } if (!$is_proibido){ if ($handle = @opendir($dir_corrente)){ // Permitido while ($file = readdir($handle)){ if ($file != "." && $file != ".." && is_dir("$dir_corrente/$file")) $mat_dir[] = $file; } closedir($handle); if (count($mat_dir)){ sort($mat_dir,SORT_STRING); // Com Sub-dir if ($indice != 0){ for ($aux=1;$aux<$indice;$aux++) echo "    "; echo "•"; } if ($dir_antes != $dir_corrente){ if (strstr($expanded_dir_list,":$dir_corrente/$dir_name")) $op_str = "[–]"; else $op_str = "[+]"; echo " $op_str $dir_name
\n"; } else { echo "$fm_root_atual
\n"; } for ($x=0;$x $dir_name
\n"; } else { echo " $fm_root_atual
\n"; } } } else { // Negado if ($dir_antes != $dir_corrente){ for ($aux=1;$aux<$indice;$aux++) echo "    "; echo "•"; echo " $dir_name
\n"; } else { echo " $fm_root_atual
\n"; } } } else { // Proibido if ($dir_antes != $dir_corrente){ for ($aux=1;$aux<$indice;$aux++) echo "    "; echo "•"; echo " $dir_name
\n"; } else { echo " $fm_root_atual
\n"; } } } function show_tree(){ global $fm_root_atual,$path_info,$setflag,$islinux; html_header(); echo "\n"; echo " "; echo "\n"; echo ""; //if (!$islinux) $aux=substr($fm_root_atual,0,strlen($fm_root_atual)-1); //else $aux=$fm_root_atual; echo ""; echo " "; echo "
"; if (!$islinux){ echo " "; } echo "
"; clearstatcache(); tree($aux,$aux,-1,0); echo "
\n"; echo "\n"; } function getmicrotime(){ list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } function dir_list_form() { global $fm_root_atual,$dir_atual,$quota_mb,$resolveIDs,$order_dir_list_by,$islinux,$cmd_name,$ip,$is_reachable,$path_info,$fm_color; $ti = getmicrotime(); clearstatcache(); $out = "\n"; if ($opdir = @opendir($dir_atual)) { $entry_count = 0; $file_count = 0; $dir_count = 0; $total_size = 0; $uplink = ""; $entry_list = array(); $highlight_cols = 0; while ($file = readdir($opdir)) { if (($file != ".")&&($file != "..")){ if (is_file($dir_atual.$file)){ $ext = strtolower(strrchr($file,".")); $entry_list[$entry_count]["type"] = "file"; // Função filetype() returns only "file"... $entry_list[$entry_count]["size"] = filesize($dir_atual.$file); $entry_list[$entry_count]["sizet"] = getsize($dir_atual.$file); if (strstr($ext,".")){ $entry_list[$entry_count]["ext"] = $ext; $entry_list[$entry_count]["extt"] = $ext; } else { $entry_list[$entry_count]["ext"] = ""; $entry_list[$entry_count]["extt"] = " "; } $file_count++; } elseif (is_dir($dir_atual.$file)) { // Recursive directory size disabled // $entry_list[$entry_count]["size"] = total_size($dir_atual.$file); $entry_list[$entry_count]["size"] = 0; $entry_list[$entry_count]["sizet"] = 0; $entry_list[$entry_count]["type"] = "dir"; $dir_count++; } $entry_list[$entry_count]["name"] = $file; $entry_list[$entry_count]["date"] = date("Ymd", filemtime($dir_atual.$file)); $entry_list[$entry_count]["time"] = date("his", filemtime($dir_atual.$file)); $entry_list[$entry_count]["datet"] = date("d/m/Y h:i:s", filemtime($dir_atual.$file)); if ($islinux && $resolveIDs){ $entry_list[$entry_count]["p"] = show_perms(fileperms($dir_atual.$file)); $entry_list[$entry_count]["u"] = getuser(fileowner($dir_atual.$file)); $entry_list[$entry_count]["g"] = getgroup(filegroup($dir_atual.$file)); } else { $entry_list[$entry_count]["p"] = base_convert(fileperms($dir_atual.$file),10,8); $entry_list[$entry_count]["p"] = substr($entry_list[$entry_count]["p"],strlen($entry_list[$entry_count]["p"])-3); $entry_list[$entry_count]["u"] = fileowner($dir_atual.$file); $entry_list[$entry_count]["g"] = filegroup($dir_atual.$file); } $total_size += $entry_list[$entry_count]["size"]; $entry_count++; } } closedir($opdir); if ($file_count) $highlight_cols = ($islinux)?7:5; else $highlight_cols = ($islinux)?6:4; if($entry_count){ $or1="1A"; $or2="2D"; $or3="3A"; $or4="4A"; $or5="5A"; $or6="6D"; $or7="7D"; switch($order_dir_list_by){ case "1A": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"name",SORT_STRING,SORT_ASC); $or1="1D"; break; case "1D": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"name",SORT_STRING,SORT_DESC); $or1="1A"; break; case "2A": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"p",SORT_STRING,SORT_ASC,"g",SORT_STRING,SORT_ASC,"u",SORT_STRING,SORT_ASC); $or2="2D"; break; case "2D": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"p",SORT_STRING,SORT_DESC,"g",SORT_STRING,SORT_ASC,"u",SORT_STRING,SORT_ASC); $or2="2A"; break; case "3A": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"u",SORT_STRING,SORT_ASC,"g",SORT_STRING,SORT_ASC); $or3="3D"; break; case "3D": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"u",SORT_STRING,SORT_DESC,"g",SORT_STRING,SORT_ASC); $or3="3A"; break; case "4A": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"g",SORT_STRING,SORT_ASC,"u",SORT_STRING,SORT_DESC); $or4="4D"; break; case "4D": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"g",SORT_STRING,SORT_DESC,"u",SORT_STRING,SORT_DESC); $or4="4A"; break; case "5A": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"size",SORT_NUMERIC,SORT_ASC); $or5="5D"; break; case "5D": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"size",SORT_NUMERIC,SORT_DESC); $or5="5A"; break; case "6A": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"date",SORT_STRING,SORT_ASC,"time",SORT_STRING,SORT_ASC,"name",SORT_STRING,SORT_ASC); $or6="6D"; break; case "6D": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"date",SORT_STRING,SORT_DESC,"time",SORT_STRING,SORT_DESC,"name",SORT_STRING,SORT_ASC); $or6="6A"; break; case "7A": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"ext",SORT_STRING,SORT_ASC,"name",SORT_STRING,SORT_ASC); $or7="7D"; break; case "7D": $entry_list = array_csort ($entry_list,"type",SORT_STRING,SORT_ASC,"ext",SORT_STRING,SORT_DESC,"name",SORT_STRING,SORT_ASC); $or7="7A"; break; } } $out .= " "; $out .= " "; $out .= " "; $dir_out=""; $file_out=""; foreach ($entry_list as $ind=>$dir_entry) { $file = $dir_entry["name"]; if ($dir_entry["type"]=="dir"){ $dir_out .= " "; } else { $file_out .= " "; } } $out .= $dir_out; if ($entry_count){ $out .= " "; $out .= " "; $out .= " "; if ($quota_mb) { $out .= " "; } else { $out .= " "; } $tf = getmicrotime(); $tt = ($tf - $ti); $out .= " "; $out .= " "; } else { $out .= " "; } } else $out .= "
$ip "; if ($dir_atual != $fm_root_atual){ $mat = explode("/",$dir_atual); $dir_antes = ""; for($x=0;$x<(count($mat)-2);$x++) $dir_antes .= $mat[$x]."/"; $uplink = "<< "; } if($entry_count){ $out .= "
$uplink $dir_atual
"; if ($islinux) $out .= " "; $out .= " "; $out .= "
$file ".$dir_entry["p"]; if ($islinux) $dir_out .= "".$dir_entry["u"]."".$dir_entry["g"]; $dir_out .= " ".$dir_entry["sizet"]." ".$dir_entry["datet"]; if ($file_count) $dir_out .= " "; // Opções de diretório if ( is_writable($dir_atual.$file) ) $dir_out .= " ".et('Rem')." ".et('Ren').""; $dir_out .= "
$file ".$dir_entry["p"]; if ($islinux) $file_out .= "".$dir_entry["u"]."".$dir_entry["g"]; $file_out .= " ".$dir_entry["sizet"]." ".$dir_entry["datet"]." ".$dir_entry["extt"]; // Opções de arquivo if ( is_writable($dir_atual.$file) ) $file_out .= " ".et('Rem')." ".et('Ren').""; if ( is_readable($dir_atual.$file) && (strpos(".wav#.mp3#.mid#.avi#.mov#.mpeg#.mpg#.rm#.iso#.bin#.img#.dll#.psd#.fla#.swf#.class#.ppt#.jpg#.gif#.png#.wmf#.eps#.bmp#.msi#.exe#.com#.rar#.tar#.zip#.bz2#.tbz2#.bz#.tbz#.bzip#.gzip#.gz#.tgz#", $dir_entry["ext"]."#" ) === false)) $file_out .= " ".et('Edit').""; if ( is_readable($dir_atual.$file) && strlen($dir_entry["ext"]) && (strpos(".tar#.zip#.bz2#.tbz2#.bz#.tbz#.bzip#.gzip#.gz#.tgz#", $dir_entry["ext"]."#" ) !== false)) $file_out .= " ".et('Decompress').""; if( $is_reachable && is_readable($dir_atual.$file) && (strpos(".txt#.sys#.bat#.ini#.conf#.swf#.php#.php3#.asp#.html#.htm#.jpg#.gif#.png#.bmp#", $dir_entry["ext"]."#" ) !== false)) $file_out .= " ".et('View').""; $file_out .= "
".et('Name')." ".et('Perms').""; if ($islinux) $out .= "".et('Owner')."".et('Group').""; $out .= " ".et('Size')." ".et('Date').""; if ($file_count) $out .= " ".et('Type').""; $out .= " "; } $out .= $file_out; $out .= "
"; if ($islinux) $out .= " "; $out .= " "; $out .= "
$dir_count ".et('Dir_s')." ".et('And')." $file_count ".et('File_s')." = ".formatsize($total_size)."
".et('Partition').": ".formatsize(($quota_mb*1024*1024))." ".et('Total')." - ".formatsize(($quota_mb*1024*1024)-total_size($fm_root_atual))." ".et('Free')."
".et('Partition').": ".formatsize(disk_total_space($dir_atual))." ".et('Total')." - ".formatsize(disk_free_space($fm_root_atual))." ".et('Free')."
".et('RenderTime').": ".substr($tt,0,strrpos($tt,".")+5)." ".et('Seconds')."
$uplink$dir_atual
".et('EmptyDir').".
".et('IOError').".
$dir_atual
"; $out .= "
"; echo $out; } function upload_form(){ global $_FILES,$dir_atual,$dir_dest,$fechar,$quota_mb,$path_info; $num_uploads = 5; html_header(); echo ""; if (count($_FILES)==0){ echo "
".et('Upload')."
".et('Destination').":$dir_atual"; for ($x=0;$x<$num_uploads;$x++){ echo "
".et('File').":"; $test_js .= "(document.upload_form.file$x.value.length>0)||"; } echo "
  ".et('AutoClose')."
 
"; } else { $out = "".et('UploadEnd')." ".et('Destination').": $dir_dest"; for ($x=0;$x<$num_uploads;$x++){ $temp_file = $_FILES["file".$x]["tmp_name"]; $filename = $_FILES["file".$x]["name"]; if (strlen($filename)) $resul = save_upload($temp_file,$filename,$dir_dest); else $resul = 7; switch($resul){ case 1: $out .= "".strzero($x+1,3).". ".et('FileSent').":".$filename."\n"; break; case 2: $out .= "".et('IOError')."\n"; $x = $upload_num; break; case 3: $out .= "".et('SpaceLimReached')." ($quota_mb Mb)\n"; $x = $upload_num; break; case 4: $out .= "".strzero($x+1,3).". ".et('InvExt').":".$filename."\n"; break; case 5: $out .= "".strzero($x+1,3).". ".et('FileNoOverw')."".$filename."\n"; break; case 6: $out .= "".strzero($x+1,3).". ".et('FileOverw').":".$filename."\n"; break; case 7: $out .= "".strzero($x+1,3).". ".et('FileIgnored')."\n"; } } if ($fechar) { echo " "; } else { echo " $out
 
"; } } echo "\n"; } function chmod_form(){ $aux = " "; html_header($aux); echo "
".et('Perms')."
".et('Owner')." ".et('Group')." ".et('Other')."
".et('Read')."
".et('Write')."
".et('Exec')."
".et('StickyBit')."
\n"; } function view(){ global $doc_root,$path_info,$url_info,$dir_atual,$islinux,$filename,$is_reachable; html_header(); echo " \n"; } function edit_file_form(){ global $dir_atual,$filename,$file_data,$save_file,$path_info; $file = $dir_atual.$filename; if ($save_file){ $fh=fopen($file,"w"); fputs($fh,$file_data,strlen($file_data)); fclose($fh); } $fh=fopen($file,"r"); $file_data=fread($fh, filesize($file)); fclose($fh); html_header(); echo "
".$file."
\n"; } function config_form(){ global $cfg; global $dir_atual,$script_filename,$doc_root,$path_info,$fm_root_atual,$lang,$error_reporting,$version; global $config_action,$newsenha,$newlang,$newerror,$newfm_root; $Warning = ""; switch ($config_action){ case 1: if ($fh = fopen("http://phpfm.sf.net/latest.php","r")){ $data = ""; while (!feof($fh)) $data .= fread($fh,1024); fclose($fh); $data = unserialize($data); $ChkVerWarning = " "; if (is_array($data)&&count($data)){ // sf.net logo $ChkVerWarning .= "\"SourceForge.net"; if (str_replace(".","",$data['version'])>str_replace(".","",$cfg->data['version'])) $ChkVerWarning .= "".et('ChkVerAvailable').""; else $ChkVerWarning .= "".et('ChkVerNotAvailable').""; } else $ChkVerWarning .= "".et('ChkVerError').""; } else $ChkVerWarning .= "".et('ChkVerError').""; break; case 2: $reload = false; if ($cfg->data['lang'] != $newlang){ $cfg->data['lang'] = $newlang; $lang = $newlang; $reload = true; } if ($cfg->data['error_reporting'] != $newerror){ $cfg->data['error_reporting'] = $newerror; $error_reporting = $newerror; $reload = true; } $newfm_root = formatpath($newfm_root); if ($cfg->data['fm_root'] != $newfm_root){ $cfg->data['fm_root'] = $newfm_root; if (strlen($newfm_root)) $dir_atual = $newfm_root; else $dir_atual = $path_info["dirname"]."/"; setcookie("fm_root_atual", $newfm_root , 0 , "/"); $reload = true; } $cfg->save(); if ($reload){ reloadframe("window.opener.parent",2); reloadframe("window.opener.parent",3); } $Warning1 = et('ConfSaved')."..."; break; case 3: if ($cfg->data['auth_pass'] != md5($newsenha)){ $cfg->data['auth_pass'] = md5($newsenha); setcookie("loggedon", md5($newsenha) , 0 , "/"); } $cfg->save(); $Warning2 = et('PassSaved')."..."; break; } html_header(); echo "\n"; echo "
".strtoupper(et('Configurations'))."
"; if (strlen($ChkVerWarning)) echo $ChkVerWarning.$data['warnings']; else echo ""; echo "
".et('Version').":$version
".et('Size').":".getsize($script_filename)."
".et('Website').":http://phpfm.sf.net
 "; echo "
".et('DocRoot').":".$doc_root."
".et('FLRoot').":data['fm_root']."\" onkeypress=\"enterSubmit(event,'test_config_form(2)')\">
".et('Lang').":
".et('ErrorReport').":
 "; if (strlen($Warning1)) echo " $Warning1"; echo "
".et('Pass').":
 "; if (strlen($Warning2)) echo " $Warning2"; echo "
"; echo "\n"; } function shell_form(){ global $dir_atual,$shell_form,$cmd_arg,$path_info; $data_out = ""; if (strlen($cmd_arg)){ exec($cmd_arg,$mat); if (count($mat)) $data_out = trim(implode("\n",$mat)); } switch ($shell_form){ case 1: html_header(); echo "
"; break; case 2: html_header(); echo " "; echo " "; echo "
"; break; default: $aux = " "; html_header($aux); echo " "; } } function server_info(){ if (!@phpinfo()) echo et('NoPhpinfo')."..."; echo "

"; $a=ini_get_all(); $output=""; while(list($key, $value)=each($a)) { list($k, $v)= each($a[$key]); $output.=""; } $output.="
$key$v
"; echo $output; echo "

"; $safe_mode=trim(ini_get("safe_mode")); if ((strlen($safe_mode)==0)||($safe_mode==0)) $safe_mode=false; else $safe_mode=true; $is_windows_server = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); echo "
".php_uname(); echo "
safe_mode".($safe_mode?"on":"off"); if ($is_windows_server) echo "
sisopWindows
"; else echo "
sisopLinux
"; echo "


"; $display_errors=ini_get("display_errors"); $ignore_user_abort = ignore_user_abort(); $max_execution_time = ini_get("max_execution_time"); $upload_max_filesize = ini_get("upload_max_filesize"); $memory_limit=ini_get("memory_limit"); $output_buffering=ini_get("output_buffering"); $default_socket_timeout=ini_get("default_socket_timeout"); $allow_url_fopen = ini_get("allow_url_fopen"); $magic_quotes_gpc = ini_get("magic_quotes_gpc"); ignore_user_abort(true); ini_set("display_errors",0); ini_set("max_execution_time",0); ini_set("upload_max_filesize","10M"); ini_set("memory_limit","20M"); ini_set("output_buffering",0); ini_set("default_socket_timeout",30); ini_set("allow_url_fopen",1); ini_set("magic_quotes_gpc",0); echo "
 GetSetGet"; echo "
display_errors$display_errors0".ini_get("display_errors"); echo "
ignore_user_abort".($ignore_user_abort?"on":"off")."on".(ignore_user_abort()?"on":"off"); echo "
max_execution_time$max_execution_time0".ini_get("max_execution_time"); echo "
upload_max_filesize$upload_max_filesize10M".ini_get("upload_max_filesize"); echo "
memory_limit$memory_limit20M".ini_get("memory_limit"); echo "
output_buffering$output_buffering0".ini_get("output_buffering"); echo "
default_socket_timeout$default_socket_timeout30".ini_get("default_socket_timeout"); echo "
allow_url_fopen$allow_url_fopen1".ini_get("allow_url_fopen"); echo "
magic_quotes_gpc$magic_quotes_gpc0".ini_get("magic_quotes_gpc"); echo "


"; echo " "; echo "\n"; } // +-------------------------------------------------- // | Session // +-------------------------------------------------- function logout(){ setcookie("loggedon",0,0,"/"); form_login(); } function login(){ global $senha,$auth_pass,$path_info; if (md5(trim($senha)) == $auth_pass){ setcookie("loggedon",$auth_pass,0,"/"); header ("Location: ".$path_info["basename"].""); } else header ("Location: ".$path_info["basename"]."?erro=1"); } function form_login(){ global $erro,$auth_pass,$path_info; html_header(); echo "\n"; if ($auth_pass != md5("")){ echo " "; if (strlen($erro)) echo " "; echo "
".et('FileMan')."
".et('TypePass').".
".et('InvPass').".
"; } else { echo "
".et('FileMan')."
"; } echo "\n"; } function frame3(){ global $islinux,$cmd_arg,$chmod_arg,$zip_dir,$fm_root_atual; global $dir_dest,$dir_atual,$dir_antes; global $selected_file_list,$selected_dir_list,$old_name,$new_name; global $action,$or_by,$order_dir_list_by; if (!isset($order_dir_list_by)){ $order_dir_list_by = "1A"; setcookie("order_dir_list_by", $order_dir_list_by , $cookie_cache_time , "/"); } elseif (strlen($or_by)){ $order_dir_list_by = $or_by; setcookie("order_dir_list_by", $or_by , $cookie_cache_time , "/"); } html_header(); echo "\n"; if ($action){ switch ($action){ case 1: // create dir if (strlen($cmd_arg)){ $cmd_arg = formatpath($dir_atual.$cmd_arg); if (!file_exists($cmd_arg)){ mkdir($cmd_arg,0777); chmod($cmd_arg,0777); reloadframe("parent",2,"&ec_dir=".$cmd_arg); } else alert(et('FileDirExists')."."); } break; case 2: // create arq if (strlen($cmd_arg)){ $cmd_arg = $dir_atual.$cmd_arg; if (!file_exists($cmd_arg)){ if ($fh = @fopen($cmd_arg, "w")){ @fclose($fh); } chmod($cmd_arg,0666); } else alert(et('FileDirExists')."."); } break; case 3: // rename arq ou dir if ((strlen($old_name))&&(strlen($new_name))){ rename($dir_atual.$old_name,$dir_atual.$new_name); if (is_dir($dir_atual.$new_name)) reloadframe("parent",2); } break; case 4: // delete sel if(strstr($dir_atual,$fm_root_atual)){ if (strlen($selected_file_list)){ $selected_file_list = explode("<|*|>",$selected_file_list); if (count($selected_file_list)) { for($x=0;$x",$selected_dir_list); if (count($selected_dir_list)) { for($x=0;$x",$selected_file_list); if (count($selected_file_list)) { for($x=0;$x",$selected_dir_list); if (count($selected_dir_list)) { for($x=0;$x",$selected_file_list); if (count($selected_file_list)) { for($x=0;$x",$selected_dir_list); if (count($selected_dir_list)) { for($x=0;$xset_options(array('basedir'=>$dir_atual,'overwrite'=>1,'level'=>3)); if (strlen($selected_file_list)){ $selected_file_list = explode("<|*|>",$selected_file_list); if (count($selected_file_list)) { for($x=0;$xadd_files($selected_file_list[$x]); } } } if (strlen($selected_dir_list)){ $selected_dir_list = explode("<|*|>",$selected_dir_list); if (count($selected_dir_list)) { for($x=0;$xadd_files($selected_dir_list[$x]); } } } $zipfile->create_archive(); } unset($zipfile); } break; case 72: // decompress arq if (strlen($cmd_arg)){ if (file_exists($dir_atual.$cmd_arg)){ $zipfile=false; if (strstr($cmd_arg,".zip")) zip_extract(); elseif (strstr($cmd_arg,".bzip")||strstr($cmd_arg,".bz2")||strstr($cmd_arg,".tbz2")||strstr($cmd_arg,".bz")||strstr($cmd_arg,".tbz")) $zipfile = new bzip_file($cmd_arg); elseif (strstr($cmd_arg,".gzip")||strstr($cmd_arg,".gz")||strstr($cmd_arg,".tgz")) $zipfile = new gzip_file($cmd_arg); elseif (strstr($cmd_arg,".tar")) $zipfile = new tar_file($cmd_arg); if ($zipfile){ $zipfile->set_options(array('basedir'=>$dir_atual,'overwrite'=>1)); $zipfile->extract_files(); } unset($zipfile); reloadframe("parent",2); } } break; case 8: // delete arq/dir if (strlen($cmd_arg)){ if (file_exists($dir_atual.$cmd_arg)) total_delete($dir_atual.$cmd_arg); if (is_dir($dir_atual.$cmd_arg)) reloadframe("parent",2); } break; case 9: // CHMOD if((strlen($chmod_arg) == 4)&&(strlen($dir_atual))){ if ($chmod_arg[0]=="1") $chmod_arg = "0".$chmod_arg; else $chmod_arg = "0".substr($chmod_arg,strlen($chmod_arg)-3); $new_mod = octdec($chmod_arg); $selected_file_list = explode("<|*|>",$selected_file_list); if (count($selected_file_list)) for($x=0;$x",$selected_dir_list); if (count($selected_dir_list)) for($x=0;$x chicago pix chicago pix lady crocs sandals canada crocs sandals canada hand chicago cubs coffee cup chicago cubs coffee cup cotton consolidated gold mine georgia consolidated gold mine georgia buy coral springs aquatic complex coral springs aquatic complex they domestic domestic travel gloucester domestic domestic travel gloucester danger cotswold hotels cotswold hotels cow cramwell spa lenox cramwell spa lenox near copenhagen cruises oceania copenhagen cruises oceania two coral egan coral egan fire chicago story vhs dvd chicago story vhs dvd term doggy daycare chicago doggy daycare chicago house chicago car audio chicago car audio law doheny beach camping reservations doheny beach camping reservations same chicago trip fun chicago trip fun separate donald shane attorney london donald shane attorney london neck coral fine art coral fine art thin chicago custom label chicago custom label back duck tours chicago duck tours chicago only diane garcia osage beach diane garcia osage beach ball chicago bank corp chicago bank corp season cocoa beach criminals cocoa beach criminals many dragon fly mandarin chicago dragon fly mandarin chicago men chicago casting agencies hotlines chicago casting agencies hotlines begin dr chad kaluza dr chad kaluza season costal range organic turkey costal range organic turkey shout colored beach wreck site colored beach wreck site history china tranportation china tranportation value chicago veterinary college founded chicago veterinary college founded year chicago bears license plates chicago bears license plates shoulder dyno tuning va beach dyno tuning va beach determine deleware marriott beach deleware marriott beach school czech republic soccer roster czech republic soccer roster least christchruch new zealand hotel christchruch new zealand hotel team china and africa 1960s china and africa 1960s language chop of france chop of france train dulles toll rd dulles toll rd matter cuba cono shirts cuba cono shirts fire dinner cruise charleston harbor dinner cruise charleston harbor five eco discovery tours eco discovery tours brown don chicago cubs pitcher don chicago cubs pitcher summer dubuque iowa hotel dubuque iowa hotel stood cimbali netherlands cimbali netherlands market construction cleanup in georgia construction cleanup in georgia king diana ross chicago theater diana ross chicago theater short cibc travel exchange cibc travel exchange green denmark 1700 coin denmark 1700 coin family cyno india cyno india round crochet turkey patterns pins crochet turkey patterns pins at deco chicago deco chicago check decleor spa relax decleor spa relax for coast of brava spain coast of brava spain came chicago tribune webmail chicago tribune webmail store colonial beach national night colonial beach national night heard chicago il lynelle chicago il lynelle start colleges in wicklow ireland colleges in wicklow ireland who easy dominican republic desserts easy dominican republic desserts you china coal production china coal production hair delimax canada delimax canada cross coolsat 6000 canada coolsat 6000 canada winter coral springs yellow pages coral springs yellow pages represent clearwater beach jet clearwater beach jet probable deiters germany 1921 deiters germany 1921 instant china adoptions and rejections china adoptions and rejections insect delta ebonic airlines delta ebonic airlines home demam berdarah di indonesia demam berdarah di indonesia then crunch south beach crunch south beach rain conchas chinas conchas chinas agree djibouti rss feed djibouti rss feed molecule ecotour of dominica island ecotour of dominica island column cylindrical hotel doors cylindrical hotel doors result eason jordan saddam cnn eason jordan saddam cnn wife cohr denmark silver cohr denmark silver star danny s bbq cary coupon danny s bbq cary coupon root chicago irish heritage center chicago irish heritage center live crack addiction treatment canada crack addiction treatment canada feed egypt basketball plays egypt basketball plays stop current affairs in spain current affairs in spain people custom tires huntington beach custom tires huntington beach help delta airlines ghana delta airlines ghana shore dental services beverly hills dental services beverly hills eye demographic of germany demographic of germany true . daily dawn pakistan daily dawn pakistan want consular notes malawi consular notes malawi start dania beach florida dania beach florida caught da lat travel guide da lat travel guide operate coast edmonton plaza hotel coast edmonton plaza hotel sit china mi ville gay china mi ville gay rain copacabana hotel acapulco mexico copacabana hotel acapulco mexico walk current events at cuba current events at cuba modern china import headbands china import headbands did early kingdoms in tanzania early kingdoms in tanzania they culebra hotels reviews culebra hotels reviews yet chicago cubs manager lou chicago cubs manager lou copy easy snakes from egypt easy snakes from egypt earth christian missions china ap christian missions china ap low cycle cross belgium cycle cross belgium always chicago childerns museum chicago childerns museum coat cuba club la cambia cuba club la cambia radio china pc ram china pc ram continent colonialism in rwanda colonialism in rwanda modern convertable tops canada convertable tops canada true . didge advantage travel didge advantage travel arrive chicago shuttle transportation chicago shuttle transportation boy discount pool tables chicago discount pool tables chicago discuss current events of senegal current events of senegal teeth chicago hook up date chicago hook up date plane dundas school bahamas dundas school bahamas tire donohue henneberry chicago donohue henneberry chicago of china water supply arsenic china water supply arsenic stand chicago public birth records chicago public birth records cause cuba guantanamo bay cuba guantanamo bay seed chicago royal aires chicago royal aires beat daytona beach vintage store daytona beach vintage store reach comoros seismic surveys comoros seismic surveys natural chicago waterfront restaurants chicago waterfront restaurants subtract criminals iraq contractors criminals iraq contractors appear cnn hotel downtown atlanta cnn hotel downtown atlanta round china crime punishments china crime punishments middle cortona italy realestate cortona italy realestate speech chicago s top lawyers chicago s top lawyers distant conversion british pound dollar conversion british pound dollar reason chicago cubs mens shorts chicago cubs mens shorts turn china beach resort china beach resort die dolmabahce palace istanbul pics dolmabahce palace istanbul pics wind dolphin and swann hotel dolphin and swann hotel round china invaders china invaders double desserts in norway desserts in norway supply craigslist athens georgia craigslist athens georgia class coleman spa pump coleman spa pump people cosmetic surgery clinic london cosmetic surgery clinic london shout chicago cop eddie murphy chicago cop eddie murphy more dayuse pool cairo dayuse pool cairo her cobra tour hat cobra tour hat party danata travel dubai danata travel dubai earth efficiency hotels birmingham alabama efficiency hotels birmingham alabama food echuca travel guide echuca travel guide gray eagle school woodstock georgia eagle school woodstock georgia indicate chicagos largest newspaper chicagos largest newspaper grew cognition and its elements cognition and its elements quite chicago breast enhancement surgeon chicago breast enhancement surgeon dad chicago gym hotel chicago gym hotel to easyriders bike tour easyriders bike tour safe club azucar chicago club azucar chicago value coleman spas coleman spas five did paris dump hunter did paris dump hunter sit coral redang island resort coral redang island resort single damascus syria temperature hotels damascus syria temperature hotels shoe d day beach assault d day beach assault near death certificates belgium death certificates belgium iron coral reed sham coral reed sham fat crs report and mozambique crs report and mozambique eye china s overpopulation effect china s overpopulation effect forest cosco philippines shipping cosco philippines shipping just dead british actresses dead british actresses sell coco beach land rover coco beach land rover sit crescent china company crescent china company west cormican family history ireland cormican family history ireland few dale earnhardt sun glasses dale earnhardt sun glasses am colonial hotel managua nic colonial hotel managua nic stick deruta italy deruta italy favor craig crane korea craig crane korea season china cabinates china cabinates distant coral reef protection bush coral reef protection bush feel dogs in spain dogs in spain ground coral bay motel coral bay motel gun chicago ticket authority chicago ticket authority speed crabs restaurant pensacola beach crabs restaurant pensacola beach then christian college rome georgia christian college rome georgia true . copyleft session eof paris copyleft session eof paris an chicago asian domestic violence chicago asian domestic violence forest dried sun dried tomatoes dried sun dried tomatoes key chicago hotels in belmont chicago hotels in belmont listen david pope georgia david pope georgia front clydesdale association of canada clydesdale association of canada parent dr paul gervais japan dr paul gervais japan weight clairon meridian hotel clairon meridian hotel tool copper mountain spa colorado copper mountain spa colorado fact eating dirt haiti eating dirt haiti keep clearwater beach and nature clearwater beach and nature prepare cypress wood chips georgia cypress wood chips georgia iron chicago jokes humor chicago jokes humor key crystal beach texas map crystal beach texas map pass discount tire solana beach discount tire solana beach numeral denmark economy graphs denmark economy graphs am christian spas in tulsa christian spas in tulsa opposite christian beck austria christian beck austria stream dungeons in london dungeons in london also cibc bank in canada cibc bank in canada shell dining in whistler canada dining in whistler canada cell china toilets potteries china toilets potteries surprise chicago ibrahim vally chicago ibrahim vally both dame blanche france dame blanche france west clearwater beach shopping clearwater beach shopping sit crw caribbean bleaching event crw caribbean bleaching event trade china village belmont ca china village belmont ca temperature cork airport ireland cork airport ireland often coca colas merchandiser georgia coca colas merchandiser georgia part clariion hotels clariion hotels set compuzone sc north charleston compuzone sc north charleston been cibc visa statements cibc visa statements paint dental implants south korea dental implants south korea spend chicago skyline 2016 photo chicago skyline 2016 photo men debia africa debia africa bear duque hotel cadiz duque hotel cadiz month consumers in the philippines consumers in the philippines our christie jordan christie jordan feet edinburgh driver tour edinburgh driver tour baby dome in malaysia dome in malaysia village cruise ships thailand cruise ships thailand repeat china scooter review china scooter review cat domestic steel industry vietnam domestic steel industry vietnam wave chicago architectural salvage yard chicago architectural salvage yard bought duncan instruments canada duncan instruments canada mean dictator spain s dictator spain s thus christian church in ethiopia christian church in ethiopia dead corona beer beach commercials corona beer beach commercials tail denmark porcelain bell denmark porcelain bell raise dr suess hotel dr suess hotel busy conversation about rwanda genocide conversation about rwanda genocide put cursed voodoo movie africa cursed voodoo movie africa bat china petrochemical co china petrochemical co cry crane tubs canada crane tubs canada flat chicago bike show 2008 chicago bike show 2008 oxygen e mail directory at croatia e mail directory at croatia better computer icons sigma chi computer icons sigma chi so clarksville county georgia probation clarksville county georgia probation case clones jim rome clones jim rome clock chicago st patrick s day chicago st patrick s day chart contemporary architecture in africa contemporary architecture in africa paragraph cnn spa ol cnn spa ol half coral attol coral attol exercise cynthia butcher chicago cynthia butcher chicago toward cultivation of nepal cardamom cultivation of nepal cardamom tree corn maze in georgia corn maze in georgia several education percentages in turkmenistan education percentages in turkmenistan horse cocoa beach relocation information cocoa beach relocation information like david frydman poland david frydman poland leave culinary schools in jamaica culinary schools in jamaica flow egypt capitalism globalization egypt capitalism globalization tail dukes lebanon nh dukes lebanon nh small coopers beach nz coopers beach nz but dirty dogs of paris dirty dogs of paris when chicago karate competition chicago karate competition so dijon airport burgundy france dijon airport burgundy france rail delta airlines milwaukee wi delta airlines milwaukee wi joy dallas ghost tours dallas ghost tours office croatia men bears croatia men bears job efl jobs and korea efl jobs and korea carry edisto beach s c edisto beach s c our dulles business corridor hotel dulles business corridor hotel front china missle satellite china missle satellite chord dana travel agency dana travel agency group delta airlines cheked bagage delta airlines cheked bagage spread educational tours in chennai educational tours in chennai spread date fruits tanzania date fruits tanzania wire corsica france telephone directory corsica france telephone directory ago doral hotel faa doral hotel faa match cuba revolution 1961 about cuba revolution 1961 about flat claymont high voltage canada claymont high voltage canada down chicago bandera restaurant menu chicago bandera restaurant menu block diesel wholesalers south africa diesel wholesalers south africa ask china southern airlines cargo china southern airlines cargo name doma chicago il doma chicago il iron clemson university southh carolina clemson university southh carolina division china bayles mysteries china bayles mysteries suit clarion hotels gatlinburg tn clarion hotels gatlinburg tn better china grill bush china grill bush am college of st ros college of st ros liquid da pitts chicago grill da pitts chicago grill only china one child policy china one child policy fair coral cove barbados problem coral cove barbados problem learn churchs chicken canada churchs chicken canada decide dart travel organizer dart travel organizer write corporate videos south africa corporate videos south africa melody china s economic geography china s economic geography column dale earnhardt monte carlo dale earnhardt monte carlo study decorative teaspoon china decorative teaspoon china burn china boycott quote china boycott quote happen chicago pizza tours chicago pizza tours else dining pine mountain georgia dining pine mountain georgia thing cruse packs to greece cruse packs to greece lost discount vacations all inclusive discount vacations all inclusive form economy hotel williamstown mass economy hotel williamstown mass mountain delta airlines promotions delta airlines promotions believe don penney georgia neurosurgery don penney georgia neurosurgery on eden hotel arizona eden hotel arizona arm chicago hotjobs chicago hotjobs make chicago bears helmets chicago bears helmets allow ebusiness and travel ebusiness and travel heavy child soldiers in kenya child soldiers in kenya mix china anthropology wholesell china anthropology wholesell mile choice hotels charleston sc choice hotels charleston sc down compact andorra juniper compact andorra juniper populate crrb iraq crrb iraq list danielsville georgia danielsville georgia self crown plaza hotel santiago crown plaza hotel santiago spread china jiangxi province china jiangxi province during ck north georgia ck north georgia came china war machine capabilities china war machine capabilities age chicago blizzard 1979 chicago blizzard 1979 unit community builders chicago community builders chicago law china doll express china doll express describe china costo holdings china costo holdings yellow compost sterilizer china compost sterilizer china trouble cuba election results cuba election results sentence clarion hotel kansas city clarion hotel kansas city block domican republic travel requirements domican republic travel requirements most cumming georgia funeral homes cumming georgia funeral homes total damian tours damian tours press cyprus village websites cyprus village websites planet dillards china patterns dillards china patterns there china t engine china t engine teach china panda bear china panda bear string customized educational tours customized educational tours when chris ward georgia chris ward georgia right chiropracter atlanta georgia chiropracter atlanta georgia quotient desert sun redmond oregon desert sun redmond oregon store competition in libya competition in libya whether dr petoskey goddard rd dr petoskey goddard rd degree discount sanfrancisco hotels discount sanfrancisco hotels up dash in myrtle beach dash in myrtle beach act cooker manufacturers in greece cooker manufacturers in greece sense crystal gayle canada crystal gayle canada motion darrington hotel london darrington hotel london ear dormotel berlin dormotel berlin fig cotford hotel great malvern cotford hotel great malvern our chicagos quarterback winning streak chicagos quarterback winning streak written cocopalm jamaica cocopalm jamaica square chicago hooka shops chicago hooka shops animal creation caribbean pool cleaner creation caribbean pool cleaner history coconut grove travel coconut grove travel pair donalsonville georgia newspaper donalsonville georgia newspaper can dental jobs in singapore dental jobs in singapore strange dunnville ontario canada map dunnville ontario canada map road clearwater beach parasail clearwater beach parasail design denmark child mental illness denmark child mental illness near culture collection japan history culture collection japan history steam craigslist cape town craigslist cape town choose chicago pringle chicago pringle bottom coral reefs vulnerability coral reefs vulnerability found diner spectacle reims diner spectacle reims desert

computer programming

lose weight

estate investments

rom their first album

wont tell

wide range

over million

instant hit

of typical laser

credit card

could ever

New Caledonia

easy way

live option

make him

dog food

United States

it separates epistemology

store summer train sleep

race car

baby boy

apartment building

Barrier Reef

hip hop

was relative to specific

noni juice

begging him

indigenous Australians

dog toys

in line with

ass hard

my feminine relatives

pragmatists wanted

wide range

Sydney Australia

domain name

female dog

erectile dysfunction

or someone who has

instant hit

twenty minutes

you is simple

It is no explanation

and old

wrapped around

independent schools

good health

unlimited music

Origin series

each she

gift ideas

Psychological warfare

the idea that a belief

Australian art

as something beyond

Search Engine

good food

would need

little sister

right now

fuck hole

cock inside

vision hearing

tight little

cute little

used car

wedding loan

integral part

toy breed

opposite sex

George Bush

couldnt get

science of managing

good news

of truth situationally

Van Halen

brought back

Market Analyst

fatty acids

of body systems and diseases

New York

man said

ice machine

in which Kurt

dynamic online

different types

Managing Executive

Shih Tzu

Another song

reefs Amboseli

successful auto

inspired by Kant

would love

arrive master track

fillable calendar template

various locations

tracee ellis ross nip slip

iPod Video

edible paint recipes

going back

trim carolina windom antenna

long term

kaiser permanente and vandever

often used

rehearsal dinner speech free samples

Kenshiro Abbe

pcp recipe

wide open

jason rabideaux

Sydney Cove

toy austrailian shepards in northern nevada

Roman Catholic

book of coma sutra

that idealist and realist

mercedez benz canada cars

programming languages

accurizing browning 3006 bar

good real

basic chow mein recipes

The islands are administratively

edo majka prikaze

hobby shop

vitantonio mfg co

shih tzu

barako obama

the dread caused

ashton drake hailey doll

Hard yakka

east indian bread recipe

multiple listing

recipes for 100 servings

good looking

cote de pablo wallpapers

over million

marks and spencer cyprus

daily basis

met art volkov

cum load

rc boat modler magazine

would give

clasificacion del parrafo

online freelance

jewlerystore

olive oil

motel 69 star torrents

good little

mga magagandang tanawin sa pilipinas

middle finger

jintha alor altar

slip win dream

horse bellyriding

wood siding

ford 300 inline six

San Diego

misty vonage interracial acid rain

type diabetes

tony danza s roasted chicken soup recipe

pet foods

mothers teach daughters oralsex

domain name

crafts for toddlers to make snowflakes

year older

glom filt rate blood tests

female body

miranda rox

get going

interracail cukold stories

the particular

acadain home model

three different

tahirah williams

prime minister

oe 254 technical manual

sports betting

cz 452 varmint custom stock

blonde hair

alicia dimarco score land

great deal

savage 16fss 223 review

good shape

used toyota tamaraw revo for sale

car buyers

axteca maseca recipe

would feel

lim jeong hee lyrics

cum covered

ron dicianni 2008 calendars

weight loss

model trains lubrication

business consulting

meals for people with ulcers

get home

pilipino food recipes

could put

snapper snowblowers troubleshooting

feel like

average cost of lumineers in ohio

Variety Access

jenny o turkey recipes

Australia working

download nite pr rev j

condo hotel

finnish christmas recipes

constitutional matters

pictures of timucuan indian huts

long black

l490 blue pill

get rid

recipe for sidewalk meth

get rid

homemade dog treat recipes sweet potato

clean off

barns and knobles

schools which

hong kong cantonese style dessert recipe

tzu puppy

gallery adel sheridan

which she did

bukowski s roll the dice

arrange camp invent cotton

nancy dell olio naked pics

United States

index r ygold pthc forum

grey parrot

bread machine recipe for panettone

term life

boone and crockett scoring sheets

asking price

power specs on 2005 gmc duramax

hot cum

slovenia food

Australia since

nudistfun 3 girls

Hong Kong

bluetooth keyboard with trackball

annoying

camia flower

would say

bra panty models pics

prime minister

job vacancy for filipino librarian

with still better results

filmes pornograficos

internet marketing

food hybrid

line voltage

violaceous striae

animal charities

ne yo blowjob

United States

tube dangdut

should always

disney flash mountain

to apply the pragmatic

1965 arctic kitten snow machine

music video

philippine nursing jurisprudence

domain name

oreo snowball cookie recipe

freely reprinted

gluten free casein free food list

great place

mike ognibene ford batavia arrest

high speed

hp pavilion dv400

specialized sub-branches

amtrust capital management

Louis Vuitton

princesa mononoke

article directories

hentii

online dating

memco wood boilers

State Park

recipes deer stakes

architectural features

recipe tuna casserole campbell s soup

left breast

dsstester files

which means

snow pudding recipe

web page

homemade molasses horse cookie recipes

snow plow
\n"; } function frame2(){ global $expanded_dir_list,$ec_dir; if (!isset($expanded_dir_list)) $expanded_dir_list = ""; if (strlen($ec_dir)){ if (strstr($expanded_dir_list,":".$ec_dir)) $expanded_dir_list = str_replace(":".$ec_dir,"",$expanded_dir_list); else $expanded_dir_list .= ":".$ec_dir; setcookie("expanded_dir_list", $expanded_dir_list , 0 , "/"); } show_tree(); } function frameset(){ global $path_info; html_header(); echo " "; echo ""; } // +-------------------------------------------------- // | Open Source Contributions // +-------------------------------------------------- /*------------------------------------------------- | TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.0 | By Devin Doucette | Copyright (c) 2004 Devin Doucette | Email: darksnoopy@shaw.ca +-------------------------------------------------- | Email bugs/suggestions to darksnoopy@shaw.ca +-------------------------------------------------- | This script has been created and released under | the GNU GPL and is free to use and redistribute | only if this copyright statement is not removed +-------------------------------------------------- | Limitations: | - Only USTAR archives are officially supported for extraction, but others may work. | - Extraction of bzip2 and gzip archives is limited to compatible tar files that have | been compressed by either bzip2 or gzip. For greater support, use the functions | bzopen and gzopen respectively for bzip2 and gzip extraction. | - Zip extraction is not supported due to the wide variety of algorithms that may be | used for compression and newer features such as encryption. +-------------------------------------------------- */ class archive { function archive($name) { $this->options = array( 'basedir'=>".", 'name'=>$name, 'prepend'=>"", 'inmemory'=>0, 'overwrite'=>0, 'recurse'=>1, 'storepaths'=>1, 'level'=>3, 'method'=>1, 'sfx'=>"", 'type'=>"", 'comment'=>"" ); $this->files = array(); $this->exclude = array(); $this->storeonly = array(); $this->error = array(); } function set_options($options) { foreach($options as $key => $value) { $this->options[$key] = $value; } if(!empty($this->options['basedir'])) { $this->options['basedir'] = str_replace("\\","/",$this->options['basedir']); $this->options['basedir'] = preg_replace("/\/+/","/",$this->options['basedir']); $this->options['basedir'] = preg_replace("/\/$/","",$this->options['basedir']); } if(!empty($this->options['name'])) { $this->options['name'] = str_replace("\\","/",$this->options['name']); $this->options['name'] = preg_replace("/\/+/","/",$this->options['name']); } if(!empty($this->options['prepend'])) { $this->options['prepend'] = str_replace("\\","/",$this->options['prepend']); $this->options['prepend'] = preg_replace("/^(\.*\/+)+/","",$this->options['prepend']); $this->options['prepend'] = preg_replace("/\/+/","/",$this->options['prepend']); $this->options['prepend'] = preg_replace("/\/$/","",$this->options['prepend']) . "/"; } } function create_archive() { $this->make_list(); if($this->options['inmemory'] == 0) { $pwd = getcwd(); chdir($this->options['basedir']); if($this->options['overwrite'] == 0 && file_exists($this->options['name'] . ($this->options['type'] == "gzip" || $this->options['type'] == "bzip"? ".tmp" : ""))) { $this->error[] = "File {$this->options['name']} already exists."; chdir($pwd); return 0; } else if($this->archive = @fopen($this->options['name'] . ($this->options['type'] == "gzip" || $this->options['type'] == "bzip"? ".tmp" : ""),"wb+")) { chdir($pwd); } else { $this->error[] = "Could not open {$this->options['name']} for writing."; chdir($pwd); return 0; } } else { $this->archive = ""; } switch($this->options['type']) { case "zip": if(!$this->create_zip()) { $this->error[] = "Could not create zip file."; return 0; } break; case "bzip": if(!$this->create_tar()) { $this->error[] = "Could not create tar file."; return 0; } if(!$this->create_bzip()) { $this->error[] = "Could not create bzip2 file."; return 0; } break; case "gzip": if(!$this->create_tar()) { $this->error[] = "Could not create tar file."; return 0; } if(!$this->create_gzip()) { $this->error[] = "Could not create gzip file."; return 0; } break; case "tar": if(!$this->create_tar()) { $this->error[] = "Could not create tar file."; return 0; } } if($this->options['inmemory'] == 0) { fclose($this->archive); chmod($this->options['name'],0666); if($this->options['type'] == "gzip" || $this->options['type'] == "bzip") { unlink($this->options['basedir'] . "/" . $this->options['name'] . ".tmp"); } } } function add_data($data) { if($this->options['inmemory'] == 0) { fwrite($this->archive,$data); } else { $this->archive .= $data; } } function make_list() { if(!empty($this->exclude)) { foreach($this->files as $key => $value) { foreach($this->exclude as $current) { if($value['name'] == $current['name']) { unset($this->files[$key]); } } } } if(!empty($this->storeonly)) { foreach($this->files as $key => $value) { foreach($this->storeonly as $current) { if($value['name'] == $current['name']) { $this->files[$key]['method'] = 0; } } } } unset($this->exclude,$this->storeonly); } function add_files($list) { $temp = $this->list_files($list); foreach($temp as $current) { $this->files[] = $current; } } function exclude_files($list) { $temp = $this->list_files($list); foreach($temp as $current) { $this->exclude[] = $current; } } function store_files($list) { $temp = $this->list_files($list); foreach($temp as $current) { $this->storeonly[] = $current; } } function list_files($list) { if(!is_array($list)) { $temp = $list; $list = array($temp); unset($temp); } $files = array(); $pwd = getcwd(); chdir($this->options['basedir']); foreach($list as $current) { $current = str_replace("\\","/",$current); $current = preg_replace("/\/+/","/",$current); $current = preg_replace("/\/$/","",$current); if(strstr($current,"*")) { $regex = preg_replace("/([\\\^\$\.\[\]\|\(\)\?\+\{\}\/])/","\\\\\\1",$current); $regex = str_replace("*",".*",$regex); $dir = strstr($current,"/")? substr($current,0,strrpos($current,"/")) : "."; $temp = $this->parse_dir($dir); foreach($temp as $current2) { if(preg_match("/^{$regex}$/i",$current2['name'])) { $files[] = $current2; } } unset($regex,$dir,$temp,$current); } else if(@is_dir($current)) { $temp = $this->parse_dir($current); foreach($temp as $file) { $files[] = $file; } unset($temp,$file); } else if(@file_exists($current)) { $files[] = array('name'=>$current,'name2'=>$this->options['prepend'] . preg_replace("/(\.+\/+)+/","",($this->options['storepaths'] == 0 && strstr($current,"/"))? substr($current,strrpos($current,"/") + 1) : $current),'type'=>0, 'ext'=>substr($current,strrpos($current,".")),'stat'=>stat($current)); } } chdir($pwd); unset($current,$pwd); usort($files,array("archive","sort_files")); return $files; } function parse_dir($dirname) { if($this->options['storepaths'] == 1 && !preg_match("/^(\.+\/*)+$/",$dirname)) { $files = array(array('name'=>$dirname,'name2'=>$this->options['prepend'] . preg_replace("/(\.+\/+)+/","",($this->options['storepaths'] == 0 && strstr($dirname,"/"))? substr($dirname,strrpos($dirname,"/") + 1) : $dirname),'type'=>5,'stat'=>stat($dirname))); } else { $files = array(); } $dir = @opendir($dirname); while($file = @readdir($dir)) { if($file == "." || $file == "..") { continue; } else if(@is_dir($dirname."/".$file)) { if(empty($this->options['recurse'])) { continue; } $temp = $this->parse_dir($dirname."/".$file); foreach($temp as $file2) { $files[] = $file2; } } else if(@file_exists($dirname."/".$file)) { $files[] = array('name'=>$dirname."/".$file,'name2'=>$this->options['prepend'] . preg_replace("/(\.+\/+)+/","",($this->options['storepaths'] == 0 && strstr($dirname."/".$file,"/"))? substr($dirname."/".$file,strrpos($dirname."/".$file,"/") + 1) : $dirname."/".$file),'type'=>0, 'ext'=>substr($file,strrpos($file,".")),'stat'=>stat($dirname."/".$file)); } } @closedir($dir); return $files; } function sort_files($a,$b) { if($a['type'] != $b['type']) { return $a['type'] > $b['type']? -1 : 1; } else if($a['type'] == 5) { return strcmp(strtolower($a['name']),strtolower($b['name'])); } else { if($a['ext'] != $b['ext']) { return strcmp($a['ext'],$b['ext']); } else if($a['stat'][7] != $b['stat'][7]) { return $a['stat'][7] > $b['stat'][7]? -1 : 1; } else { return strcmp(strtolower($a['name']),strtolower($b['name'])); } } return 0; } function download_file() { if($this->options['inmemory'] == 0) { $this->error[] = "Can only use download_file() if archive is in memory. Redirect to file otherwise, it is faster."; return; } switch($this->options['type']) { case "zip": header("Content-type:application/zip"); break; case "bzip": header("Content-type:application/x-compressed"); break; case "gzip": header("Content-type:application/x-compressed"); break; case "tar": header("Content-type:application/x-tar"); } $header = "Content-disposition: attachment; filename=\""; $header .= strstr($this->options['name'],"/")? substr($this->options['name'],strrpos($this->options['name'],"/") + 1) : $this->options['name']; $header .= "\""; header($header); header("Content-length: " . strlen($this->archive)); header("Content-transfer-encoding: binary"); header("Cache-control: no-cache, must-revalidate, post-check=0, pre-check=0"); header("Pragma: no-cache"); header("Expires: 0"); print($this->archive); } } class tar_file extends archive { function tar_file($name) { $this->archive($name); $this->options['type'] = "tar"; } function create_tar() { $pwd = getcwd(); chdir($this->options['basedir']); foreach($this->files as $current) { if($current['name'] == $this->options['name']) { continue; } if(strlen($current['name2']) > 99) { $path = substr($current['name2'],0,strpos($current['name2'],"/",strlen($current['name2']) - 100) + 1); $current['name2'] = substr($current['name2'],strlen($path)); if(strlen($path) > 154 || strlen($current['name2']) > 99) { $this->error[] = "Could not add {$path}{$current['name2']} to archive because the filename is too long."; continue; } } $block = pack("a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12",$current['name2'],decoct($current['stat'][2]), sprintf("%6s ",decoct($current['stat'][4])),sprintf("%6s ",decoct($current['stat'][5])), sprintf("%11s ",decoct($current['stat'][7])),sprintf("%11s ",decoct($current['stat'][9])), " ",$current['type'],"","ustar","00","Unknown","Unknown","","",!empty($path)? $path : "",""); $checksum = 0; for($i = 0; $i < 512; $i++) { $checksum += ord(substr($block,$i,1)); } $checksum = pack("a8",sprintf("%6s ",decoct($checksum))); $block = substr_replace($block,$checksum,148,8); if($current['stat'][7] == 0) { $this->add_data($block); } else if($fp = @fopen($current['name'],"rb")) { $this->add_data($block); while($temp = fread($fp,1048576)) { $this->add_data($temp); } if($current['stat'][7] % 512 > 0) { $temp = ""; for($i = 0; $i < 512 - $current['stat'][7] % 512; $i++) { $temp .= "\0"; } $this->add_data($temp); } fclose($fp); } else { $this->error[] = "Could not open file {$current['name']} for reading. It was not added."; } } $this->add_data(pack("a512","")); chdir($pwd); return 1; } function extract_files() { $pwd = getcwd(); chdir($this->options['basedir']); if($fp = $this->open_archive()) { if($this->options['inmemory'] == 1) { $this->files = array(); } while($block = fread($fp,512)) { $temp = unpack("a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100temp/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp",$block); $file = array( 'name'=>$temp['prefix'] . $temp['name'], 'stat'=>array( 2=>$temp['mode'], 4=>octdec($temp['uid']), 5=>octdec($temp['gid']), 7=>octdec($temp['size']), 9=>octdec($temp['mtime']), ), 'checksum'=>octdec($temp['checksum']), 'type'=>$temp['type'], 'magic'=>$temp['magic'], ); if($file['checksum'] == 0x00000000) { break; } else if($file['magic'] != "ustar") { $this->error[] = "This script does not support extracting this type of tar file."; break; } $block = substr_replace($block," ",148,8); $checksum = 0; for($i = 0; $i < 512; $i++) { $checksum += ord(substr($block,$i,1)); } if($file['checksum'] != $checksum) { $this->error[] = "Could not extract from {$this->options['name']}, it is corrupt."; } if($this->options['inmemory'] == 1) { $file['data'] = fread($fp,$file['stat'][7]); fread($fp,(512 - $file['stat'][7] % 512) == 512? 0 : (512 - $file['stat'][7] % 512)); unset($file['checksum'],$file['magic']); $this->files[] = $file; } else { if($file['type'] == 5) { if(!is_dir($file['name'])) { mkdir($file['name'],0777); //mkdir($file['name'],$file['stat'][2]); //chown($file['name'],$file['stat'][4]); //chgrp($file['name'],$file['stat'][5]); } } else if($this->options['overwrite'] == 0 && file_exists($file['name'])) { $this->error[] = "{$file['name']} already exists."; } else if($new = @fopen($file['name'],"wb")) { fwrite($new,fread($fp,$file['stat'][7])); fread($fp,(512 - $file['stat'][7] % 512) == 512? 0 : (512 - $file['stat'][7] % 512)); fclose($new); chmod($file['name'],0666); //chmod($file['name'],$file['stat'][2]); //chown($file['name'],$file['stat'][4]); //chgrp($file['name'],$file['stat'][5]); } else { $this->error[] = "Could not open {$file['name']} for writing."; } } unset($file); } } else { $this->error[] = "Could not open file {$this->options['name']}"; } chdir($pwd); } function open_archive() { return @fopen($this->options['name'],"rb"); } } class gzip_file extends tar_file { function gzip_file($name) { $this->tar_file($name); $this->options['type'] = "gzip"; } function create_gzip() { if($this->options['inmemory'] == 0) { $pwd = getcwd(); chdir($this->options['basedir']); if($fp = gzopen($this->options['name'],"wb{$this->options['level']}")) { fseek($this->archive,0); while($temp = fread($this->archive,1048576)) { gzwrite($fp,$temp); } gzclose($fp); chdir($pwd); } else { $this->error[] = "Could not open {$this->options['name']} for writing."; chdir($pwd); return 0; } } else { $this->archive = gzencode($this->archive,$this->options['level']); } return 1; } function open_archive() { return @gzopen($this->options['name'],"rb"); } } class bzip_file extends tar_file { function bzip_file($name) { $this->tar_file($name); $this->options['type'] = "bzip"; } function create_bzip() { if($this->options['inmemory'] == 0) { $pwd = getcwd(); chdir($this->options['basedir']); if($fp = bzopen($this->options['name'],"wb")) { fseek($this->archive,0); while($temp = fread($this->archive,1048576)) { bzwrite($fp,$temp); } bzclose($fp); chdir($pwd); } else { $this->error[] = "Could not open {$this->options['name']} for writing."; chdir($pwd); return 0; } } else { $this->archive = bzcompress($this->archive,$this->options['level']); } return 1; } function open_archive() { return @bzopen($this->options['name'],"rb"); } } class zip_file extends archive { function zip_file($name) { $this->archive($name); $this->options['type'] = "zip"; } function create_zip() { $files = 0; $offset = 0; $central = ""; if(!empty($this->options['sfx'])) { if($fp = @fopen($this->options['sfx'],"rb")) { $temp = fread($fp,filesize($this->options['sfx'])); fclose($fp); $this->add_data($temp); $offset += strlen($temp); unset($temp); } else { $this->error[] = "Could not open sfx module from {$this->options['sfx']}."; } } $pwd = getcwd(); chdir($this->options['basedir']); foreach($this->files as $current) { if($current['name'] == $this->options['name']) { continue; } $translate = array('Ç'=>pack("C",128),'ü'=>pack("C",129),'é'=>pack("C",130),'â'=>pack("C",131),'ä'=>pack("C",132), 'à'=>pack("C",133),'å'=>pack("C",134),'ç'=>pack("C",135),'ê'=>pack("C",136),'ë'=>pack("C",137), 'è'=>pack("C",138),'ï'=>pack("C",139),'î'=>pack("C",140),'ì'=>pack("C",141),'Ä'=>pack("C",142), 'Å'=>pack("C",143),'É'=>pack("C",144),'æ'=>pack("C",145),'Æ'=>pack("C",146),'ô'=>pack("C",147), 'ö'=>pack("C",148),'ò'=>pack("C",149),'û'=>pack("C",150),'ù'=>pack("C",151),'_'=>pack("C",152), 'Ö'=>pack("C",153),'Ü'=>pack("C",154),'£'=>pack("C",156),'¥'=>pack("C",157),'_'=>pack("C",158), 'ƒ'=>pack("C",159),'á'=>pack("C",160),'í'=>pack("C",161),'ó'=>pack("C",162),'ú'=>pack("C",163), 'ñ'=>pack("C",164),'Ñ'=>pack("C",165)); $current['name2'] = strtr($current['name2'],$translate); $timedate = explode(" ",date("Y n j G i s",$current['stat'][9])); $timedate = ($timedate[0] - 1980 << 25) | ($timedate[1] << 21) | ($timedate[2] << 16) | ($timedate[3] << 11) | ($timedate[4] << 5) | ($timedate[5]); $block = pack("VvvvV",0x04034b50,0x000A,0x0000,(isset($current['method']) || $this->options['method'] == 0)? 0x0000 : 0x0008,$timedate); if($current['stat'][7] == 0 && $current['type'] == 5) { $block .= pack("VVVvv",0x00000000,0x00000000,0x00000000,strlen($current['name2']) + 1,0x0000); $block .= $current['name2'] . "/"; $this->add_data($block); $central .= pack("VvvvvVVVVvvvvvVV",0x02014b50,0x0014,$this->options['method'] == 0? 0x0000 : 0x000A,0x0000, (isset($current['method']) || $this->options['method'] == 0)? 0x0000 : 0x0008,$timedate, 0x00000000,0x00000000,0x00000000,strlen($current['name2']) + 1,0x0000,0x0000,0x0000,0x0000,$current['type'] == 5? 0x00000010 : 0x00000000,$offset); $central .= $current['name2'] . "/"; $files++; $offset += (31 + strlen($current['name2'])); } else if($current['stat'][7] == 0) { $block .= pack("VVVvv",0x00000000,0x00000000,0x00000000,strlen($current['name2']),0x0000); $block .= $current['name2']; $this->add_data($block); $central .= pack("VvvvvVVVVvvvvvVV",0x02014b50,0x0014,$this->options['method'] == 0? 0x0000 : 0x000A,0x0000, (isset($current['method']) || $this->options['method'] == 0)? 0x0000 : 0x0008,$timedate, 0x00000000,0x00000000,0x00000000,strlen($current['name2']),0x0000,0x0000,0x0000,0x0000,$current['type'] == 5? 0x00000010 : 0x00000000,$offset); $central .= $current['name2']; $files++; $offset += (30 + strlen($current['name2'])); } else if($fp = @fopen($current['name'],"rb")) { $temp = fread($fp,$current['stat'][7]); fclose($fp); $crc32 = crc32($temp); if(!isset($current['method']) && $this->options['method'] == 1) { $temp = gzcompress($temp,$this->options['level']); $size = strlen($temp) - 6; $temp = substr($temp,2,$size); } else { $size = strlen($temp); } $block .= pack("VVVvv",$crc32,$size,$current['stat'][7],strlen($current['name2']),0x0000); $block .= $current['name2']; $this->add_data($block); $this->add_data($temp); unset($temp); $central .= pack("VvvvvVVVVvvvvvVV",0x02014b50,0x0014,$this->options['method'] == 0? 0x0000 : 0x000A,0x0000, (isset($current['method']) || $this->options['method'] == 0)? 0x0000 : 0x0008,$timedate, $crc32,$size,$current['stat'][7],strlen($current['name2']),0x0000,0x0000,0x0000,0x0000,0x00000000,$offset); $central .= $current['name2']; $files++; $offset += (30 + strlen($current['name2']) + $size); } else { $this->error[] = "Could not open file {$current['name']} for reading. It was not added."; } } $this->add_data($central); $this->add_data(pack("VvvvvVVv",0x06054b50,0x0000,0x0000,$files,$files,strlen($central),$offset, !empty($this->options['comment'])? strlen($this->options['comment']) : 0x0000)); if(!empty($this->options['comment'])) { $this->add_data($this->options['comment']); } chdir($pwd); return 1; } } // +-------------------------------------------------- // | THE END // +-------------------------------------------------- ?>