Beruflich Dokumente
Kultur Dokumente
php
ue;
$charset = "UTF-8";
//@setlocale(LC_CTYPE, 'C');
header("Pragma: no-cache");
header("Cache-Control: no-store");
header("Content-Type: text/html; charset=".$charset);
//@ini_set('default_charset', $charset);
if (@get_magic_quotes_gpc()) {
function stripslashes_deep($value){
return is_array($value)? array_map('stripslashes_deep', $value):$val
}
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
// Server Vars
function get_client_ip() {
$ipaddress = '';
if ($_SERVER['HTTP_CLIENT_IP']) $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if($_SERVER['HTTP_X_FORWARDED_FOR']) $ipaddress = $_SERVER['HTTP_X_
FORWARDED_FOR'];
else if($_SERVER['HTTP_X_FORWARDED']) $ipaddress = $_SERVER['HTTP_X_FORW
ARDED'];
else if($_SERVER['HTTP_FORWARDED_FOR']) $ipaddress = $_SERVER['HTTP_FORW
ARDED_FOR'];
else if($_SERVER['HTTP_FORWARDED']) $ipaddress = $_SERVER['HTTP_FORWARDE
D'];
else if($_SERVER['REMOTE_ADDR']) $ipaddress = $_SERVER['REMOTE_ADDR'];
// proxy transparente no esconde o IP local, colocando ele aps o I
P da rede, separado por vrgula
if (strpos($ipaddress, ',') !== false) {
$ips = explode(',', $ipaddress);
$ipaddress = trim($ips[0]);
}
if ($ipaddress == '::1') $ipaddress = '';
return $ipaddress;
}
$ip = get_client_ip();
$islinux = !(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
function getServerURL() {
$url = ($_SERVER["HTTPS"] == "on")?"https://":"http://";
$url .= $_SERVER["SERVER_NAME"]; // $_SERVER["HTTP_HOST"] is equivalent
if ($_SERVER["SERVER_PORT"] != "80") $url .= ":".$_SERVER["SERVER_PORT"]
;
return $url;
}
function getCompleteURL() {
return getServerURL().$_SERVER["REQUEST_URI"];
}
$url = getCompleteURL();
$url_info = parse_url($url);
if( !isset($_SERVER['DOCUMENT_ROOT']) ) {
if ( isset($_SERVER['SCRIPT_FILENAME']) ) $path = $_SERVER['SCRI
PT_FILENAME'];
elseif ( isset($_SERVER['PATH_TRANSLATED']) ) $path = str_replac
e('\\\\', '\\', $_SERVER['PATH_TRANSLATED']);
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($path
, 0, 0-strlen($_SERVER['PHP_SELF'])));
}
$doc_root = str_replace('//','/',str_replace(DIRECTORY_SEPARATOR,'/',$_S
ERVER["DOCUMENT_ROOT"]));
$fm_self = $doc_root.$_SERVER["PHP_SELF"];
$path_info = pathinfo($fm_self);
// Register Globals
$blockKeys = array('_SERVER','_SESSION','_GET','_POST','_COOKIE','charse
t','ip','islinux','url','url_info','doc_root','fm_self','path_info');
foreach ($_GET as $key => $val) if (array_search($key,$blockKeys) === false)
$$key=$val;
foreach ($_POST as $key => $val) if (array_search($key,$blockKeys) === false
) $$key=$val;
foreach ($_COOKIE as $key => $val) if (array_search($key,$blockKeys) === fal
se) $$key=$val;
// +-------------------------------------------------// | Config
// +-------------------------------------------------$cfg = new config();
$cfg->load();
switch ($error_reporting){
case 0: error_reporting(0); @ini_set("display_errors",0); break;
case 1: error_reporting(E_ERROR | E_PARSE | E_COMPILE_ERROR); @ini_set("
display_errors",1); break;
case 2: error_reporting(E_ALL); @ini_set("display_errors",1); break;
}
if (!isset($current_dir)){
$current_dir = $path_info["dirname"]."/";
if (!$islinux) $current_dir = ucfirst($current_dir);
//@chmod($current_dir,0755);
} else $current_dir = format_path($current_dir);
// Auto Expand Local Path
if (!isset($expanded_dir_list)){
$expanded_dir_list = "";
$mat = explode("/",$path_info["dirname"]);
for ($x=0;$x<count($mat);$x++) $expanded_dir_list .= ":".$mat[$x];
setcookie("expanded_dir_list", $expanded_dir_list, 0, "/");
}
if (!isset($fm_current_root)){
if (strlen($fm_root)) $fm_current_root = $fm_root;
else {
if (!$islinux) $fm_current_root = ucfirst($path_info["dirname"]."/")
;
else $fm_current_root = $doc_root."/";
}
setcookie("fm_current_root", $fm_current_root, 0, "/");
} elseif (isset($set_fm_current_root)) {
if (!$islinux) $fm_current_root = ucfirst($set_fm_current_root);
setcookie("fm_current_root", $fm_current_root, 0, "/");
}
if (!isset($resolveIDs)){
setcookie("resolveIDs", 0, time()+$cookie_cache_time, "/");
} elseif (isset($set_resolveIDs)){
$resolveIDs=($resolveIDs)?0:1;
setcookie("resolveIDs", $resolveIDs, time()+$cookie_cache_time, "/");
}
if ($resolveIDs){
exec("cat /etc/passwd",$mat_passwd);
exec("cat /etc/group",$mat_group);
}
$fm_color['Bg'] = "EEEEEE";
$fm_color['Text'] = "000000";
$fm_color['Link'] = "0A77F7";
$fm_color['Entry'] = "FFFFFF";
$fm_color['Over'] = "C0EBFD";
$fm_color['Mark'] = "A7D2E4";
foreach($fm_color as $tag=>$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_cmd(); break;
case 7: edit_file_form(); break;
case 8: chmod_form(); break;
case 9: shell_form(); break;
case 10: upload_form(); break;
case 11: execute_file(); break;
default: frameset();
}
}
} else {
if (isset($pass)) login();
else login_form();
}
// +-------------------------------------------------// | Config Class
// +-------------------------------------------------class config {
var $data;
var $filename;
function config(){
global $fm_self;
$this->data = array(
'lang'=>'en',
'auth_pass'=>md5(''),
'quota_mb'=>0,
'upload_ext_filter'=>array(),
'download_ext_filter'=>array(),
'error_reporting'=>1,
'fm_root'=>'',
'cookie_cache_time'=>60*60*24*30, // 30 Days
'version'=>'0.9.8'
);
$data = false;
$this->filename = $fm_self;
if (file_exists($this->filename)){
$mat = file($this->filename);
$objdata = trim(substr($mat[1],2));
if (strlen($objdata)) $data = unserialize($objdata);
ta;
}
if (is_array($data)&&count($data)==count($this->data)) $this->data = $da
else $this->save();
}
function save(){
$objdata = "<?php".chr(13).chr(10)."//".serialize($this->data).chr(13).c
hr(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;$x<count($mat);$x++) @fputs($fh,$mat[$x],strlen($m
at[$x]));
@fclose($fh);
}
}
}
}
function load(){
foreach ($this->data as $key => $val) $GLOBALS[$key] = $val;
}
}
// +-------------------------------------------------// | Internationalization
// +-------------------------------------------------function et($tag){
global $lang;
// English - by Fabricio Seger Kolling
$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['Perm'] = 'Perm';
$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 c
ompression 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';
$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'] = 'Configuraes';
$pt['JSError'] = 'Erro de JavaScript';
$pt['NoSel'] = 'No h itens selecionados';
$pt['SelDir'] = 'Selecione o diretrio de destino na rvore a esquerda';
$pt['TypeDir'] = 'Digite o nome do diretrio';
$pt['TypeArq'] = 'Digite o nome do arquivo';
$pt['TypeCmd'] = 'Digite o commando';
$pt['TypeArqComp'] = 'Digite o nome do arquivo.\\nA extenso determina o tipo
de compactao.\\nEx:\\nnome.zip\\nnome.tar\\nnome.bzip\\nnome.gzip';
$pt['RemSel'] = 'APAGAR itens selecionados';
$pt['NoDestDir'] = 'No h um diretrio de destino selecionado';
$pt['DestEqOrig'] = 'Diretrio de origem e destino iguais';
$pt['InvalidDest'] = 'Diretrio de destino invlido';
$pt['NoNewPerm'] = 'Nova permisso no foi setada';
$pt['CopyTo'] = 'COPIAR para';
$pt['MoveTo'] = 'MOVER para';
$pt['AlterPermTo'] = 'ALTERAR PERMISSES para';
$pt['ConfExec'] = 'Confirma EXECUTAR';
$pt['ConfRem'] = 'Confirma APAGAR';
$pt['EmptyDir'] = 'Diretrio vazio';
$pt['IOError'] = 'Erro de E/S';
$pt['FileMan'] = 'PHP File Manager';
$pt['TypePass'] = 'Digite a senha';
$pt['InvPass'] = 'Senha Invlida';
$pt['ReadDenied'] = 'Acesso de leitura negado';
$pt['FileNotFound'] = 'Arquivo no encontrado';
$pt['AutoClose'] = 'Fechar Automaticamente';
$pt['OutDocRoot'] = 'Arquivo fora do DOCUMENT_ROOT';
$pt['NoCmd'] = 'Erro: Comando no informado';
$pt['ConfTrySave'] = 'Arquivo sem permisso de escrita.\\nTentar salvar assim
mesmo';
$pt['ConfSaved'] = 'Configuraes salvas';
$pt['PassSaved'] = 'Senha salva';
$pt['FileDirExists'] = 'Arquivo ou diretrio j existe';
$pt['NoPhpinfo'] = 'Funo phpinfo desabilitada';
$pt['NoReturn'] = 'sem retorno';
$pt['FileSent'] = 'Arquivo enviado';
$pt['SpaceLimReached'] = 'Limite de espao alcanado';
$pt['InvExt'] = 'Extenso invlida';
$pt['FileNoOverw'] = 'Arquivo no pode ser sobreescrito';
$pt['FileOverw'] = 'Arquivo sobreescrito';
$pt['FileIgnored'] = 'Arquivo omitido';
$pt['ChkVer'] = 'Verificar por nova verso';
$pt['ChkVerAvailable'] = 'Nova verso, clique aqui para iniciar download!!';
$pt['ChkVerNotAvailable'] = 'No h nova verso disponvel. :(';
$pt['ChkVerError'] = 'Erro de conexo.';
$pt['Website'] = 'Website';
$pt['SendingForm'] = 'Enviando arquivos, aguarde';
$es['Dir_s'] = 'directorio(s)';
$es['To'] = 'a';
$es['Destination'] = 'Destino';
$es['Configurations'] = 'Configuracion';
$es['JSError'] = 'Error de JavaScript';
$es['NoSel'] = 'No hay items seleccionados';
$es['SelDir'] = 'Seleccione el directorio de destino en el arbol derecho';
$es['TypeDir'] = 'Escriba el nombre del directorio';
$es['TypeArq'] = 'Escriba el nombre del archivo';
$es['TypeCmd'] = 'Escriba el comando';
$es['TypeArqComp'] = 'Escriba el nombre del directorio.\\nLa extension defin
ira el tipo de compresion.\\nEj:\\nnome.zip\\nnome.tar\\nnome.bzip\\nnome.gzip';
$es['RemSel'] = 'BORRAR items seleccionados';
$es['NoDestDir'] = 'No se ha seleccionado el directorio de destino';
$es['DestEqOrig'] = 'El origen y el destino son iguales';
$es['InvalidDest'] = 'El destino del directorio es invalido';
$es['NoNewPerm'] = 'Las permisiones no se pudieron establecer';
$es['CopyTo'] = 'COPIAR a';
$es['MoveTo'] = 'MOVER a';
$es['AlterPermTo'] = 'CAMBIAR PERMISIONES a';
$es['ConfExec'] = 'Confirmar EJECUCION';
$es['ConfRem'] = 'Confirmar BORRADO';
$es['EmptyDir'] = 'Directorio Vacio';
$es['IOError'] = 'Error I/O';
$es['FileMan'] = 'PHP File Manager';
$es['TypePass'] = 'Escriba la contrasea';
$es['InvPass'] = 'Contrasea invalida';
$es['ReadDenied'] = 'Acceso de lectura denegado';
$es['FileNotFound'] = 'Archivo no encontrado';
$es['AutoClose'] = 'Cerrar al completar';
$es['OutDocRoot'] = 'Archivo antes de DOCUMENT_ROOT';
$es['NoCmd'] = 'Error: No se ha escrito ningun comando';
$es['ConfTrySave'] = 'Archivo sin permisos de escritura.\\nIntente guardar e
n otro lugar';
$es['ConfSaved'] = 'Configuracion Guardada';
$es['PassSaved'] = 'Contrasea guardada';
$es['FileDirExists'] = 'Archivo o directorio ya existente';
$es['NoPhpinfo'] = 'Funcion phpinfo() inhabilitada';
$es['NoReturn'] = 'sin retorno';
$es['FileSent'] = 'Archivo enviado';
$es['SpaceLimReached'] = 'Limite de espacio en disco alcanzado';
$es['InvExt'] = 'Extension inalida';
$es['FileNoOverw'] = 'El archivo no pudo ser sobreescrito';
$es['FileOverw'] = 'Archivo sobreescrito';
$es['FileIgnored'] = 'Archivo ignorado';
$es['ChkVer'] = 'Chequear las actualizaciones';
$es['ChkVerAvailable'] = 'Nueva version, haga click aqui para descargar!!';
$es['ChkVerNotAvailable'] = 'Su version es la mas reciente.';
$es['ChkVerError'] = 'Error de coneccion.';
$es['Website'] = 'Sitio Web';
$es['SendingForm'] = 'Enviando archivos, espere!';
$es['NoFileSel'] = 'Ningun archivo seleccionado';
$es['SelAll'] = 'Todos';
$es['SelNone'] = 'Ninguno';
$es['SelInverse'] = 'Inverso';
$es['Selected_s'] = 'seleccionado';
$es['Total'] = 'total';
$es['Partition'] = 'Particion';
$es['RenderTime'] = 'Generado en';
$es['Seconds'] = 'seg';
';
.\\n :\\nnome.zip\\nnome.tar\\nn
$kr['RemSel'] = '
';
$kr['NoDestDir'] = '
.';
$kr['DestEqOrig'] = '
';
$kr['NoNewPerm'] = '
';
$kr['CopyTo'] = '
';
$kr['MoveTo'] = '
';
$kr['AlterPermTo'] = '
';
$kr['ConfExec'] = '
';
$kr['ConfRem'] = '
';
$kr['EmptyDir'] = '
';
$kr['IOError'] = ' /
';
$kr['FileMan'] = 'PHP
';
$kr['TypePass'] = '
';
$kr['InvPass'] = '
';
$kr['ReadDenied'] = '
';
$kr['FileNotFound'] = '
';
$kr['AutoClose'] = '
';
$kr['OutDocRoot'] = 'DOCUMENT_ROOT
';
$kr['NoCmd'] = ' :
';
$kr['ConfTrySave'] = '
.\\n
$kr['ConfSaved'] = '
';
$kr['PassSaved'] = '
';
$kr['FileDirExists'] = '
';
$kr['NoPhpinfo'] = 'PHPINFO()
';
$kr['NoReturn'] = '
';
$kr['FileSent'] = '
';
$kr['SpaceLimReached'] = '
';
$kr['InvExt'] = '
';
$kr['FileNoOverw'] = '
';
$kr['FileOverw'] = '
';
$kr['FileIgnored'] = '
';
$kr['ChkVer'] = '
';
$kr['ChkVerAvailable'] = '
.
$kr['ChkVerNotAvailable'] = '
. :(';
$kr['ChkVerError'] = '
';
$kr['Website'] = '
';
$kr['SendingForm'] = '
.
';
$kr['NoFileSel'] = '
';
$kr['SelAll'] = ' ';
$kr['SelNone'] = ' ';
$kr['SelInverse'] = ' ';
// German - by Guido Ogrzal
$de1['Version'] = 'Version';
$de1['DocRoot'] = 'Dokument Wurzelverzeichnis';
$de1['FLRoot'] = 'Dateimanager Wurzelverzeichnis';
$de1['Name'] = 'Name';
$de1['And'] = 'und';
$de1['Enter'] = 'Eintreten';
$de1['Send'] = 'Senden';
$de1['Refresh'] = 'Aktualisieren';
$de1['SaveConfig'] = 'Konfiguration speichern';
$de1['SavePass'] = 'Passwort speichern';
$de1['SaveFile'] = 'Datei speichern';
$de1['Save'] = 'Speichern';
$de1['Leave'] = 'Verlassen';
$de1['Edit'] = 'Bearbeiten';
$de1['View'] = 'Ansehen';
$de1['Config'] = 'Konfigurieren';
$de1['Ren'] = 'Umbenennen';
';
!!';
$de1['Rem'] = 'Lschen';
$de1['Compress'] = 'Komprimieren';
$de1['Decompress'] = 'Dekomprimieren';
$de1['ResolveIDs'] = 'Resolve IDs';
$de1['Move'] = 'Verschieben';
$de1['Copy'] = 'Kopieren';
$de1['ServerInfo'] = 'Server-Info';
$de1['CreateDir'] = 'Neues Verzeichnis';
$de1['CreateArq'] = 'Neue Datei';
$de1['ExecCmd'] = 'Kommando';
$de1['Upload'] = 'Datei hochladen';
$de1['UploadEnd'] = 'Datei hochladen beendet';
$de1['Perm'] = 'Erlaubnis';
$de1['Perms'] = 'Erlaubnis';
$de1['Owner'] = 'Besitzer';
$de1['Group'] = 'Gruppe';
$de1['Other'] = 'Andere';
$de1['Size'] = 'Gre';
$de1['Date'] = 'Datum';
$de1['Type'] = 'Typ';
$de1['Free'] = 'frei';
$de1['Shell'] = 'Shell';
$de1['Read'] = 'Lesen';
$de1['Write'] = 'Schreiben';
$de1['Exec'] = 'Ausfhren';
$de1['Apply'] = 'Besttigen';
$de1['StickyBit'] = 'Sticky Bit';
$de1['Pass'] = 'Passwort';
$de1['Lang'] = 'Sprache';
$de1['File'] = 'Datei';
$de1['File_s'] = 'Datei(en)';
$de1['Dir_s'] = 'Verzeichniss(e)';
$de1['To'] = '->';
$de1['Destination'] = 'Ziel';
$de1['Configurations'] = 'Konfiguration';
$de1['JSError'] = 'JavaScript Fehler';
$de1['NoSel'] = 'Es gibt keine selektierten Objekte';
$de1['SelDir'] = 'Selektiere das Zielverzeichnis im linken Verzeichnisbaum';
$de1['TypeDir'] = 'Trage den Verzeichnisnamen ein';
$de1['TypeArq'] = 'Trage den Dateinamen ein';
$de1['TypeCmd'] = 'Gib das Kommando ein';
$de1['TypeArqComp'] = 'Trage den Dateinamen ein.\\nDie Dateierweiterung wird
den Kompressiontyp bestimmen.\\nBsp.:\\nnome.zip\\nnome.tar\\nnome.bzip\\nnome.
gzip';
$de1['RemSel'] = 'LSCHE die selektierten Objekte';
$de1['NoDestDir'] = 'Das selektierte Zielverzeichnis existiert nicht';
$de1['DestEqOrig'] = 'Quell- und Zielverzeichnis stimmen berein';
$de1['InvalidDest'] = 'Zielverzeichnis ist ungltig';
$de1['NoNewPerm'] = 'Neue Zugriffserlaubnis konnte nicht gesetzt werden';
$de1['CopyTo'] = 'KOPIERE nach';
$de1['MoveTo'] = 'VERSCHIEBE nach';
$de1['AlterPermTo'] = 'NDERE ZUGRIFFSERLAUBSNIS in';
$de1['ConfExec'] = 'Besttige AUSFHRUNG';
$de1['ConfRem'] = 'Besttige LSCHEN';
$de1['EmptyDir'] = 'Leeres Verzeichnis';
$de1['IOError'] = 'Eingabe/Ausgabe-Fehler';
$de1['FileMan'] = 'PHP File Manager';
$de1['TypePass'] = 'Trage das Passwort ein';
$de1['InvPass'] = 'Ungltiges Passwort';
$de1['ReadDenied'] = 'Lesezugriff verweigert';
$de3['Group'] = 'Gruppe';
$de3['Other'] = 'Andere';
$de3['Size'] = 'Groesse';
$de3['Date'] = 'Datum';
$de3['Type'] = 'Typ';
$de3['Free'] = 'frei';
$de3['Shell'] = 'Shell';
$de3['Read'] = 'Lesen';
$de3['Write'] = 'Schreiben';
$de3['Exec'] = 'Ausfuehren';
$de3['Apply'] = 'Bestaetigen';
$de3['StickyBit'] = 'Sticky Bit';
$de3['Pass'] = 'Passwort';
$de3['Lang'] = 'Sprache';
$de3['File'] = 'Datei';
$de3['File_s'] = 'Datei(en)';
$de3['Dir_s'] = 'Ordner';
$de3['To'] = 'nach';
$de3['Destination'] = 'Ziel';
$de3['Configurations'] = 'Konfiguration';
$de3['JSError'] = 'JavaScript Error';
$de3['NoSel'] = 'Keine Objekte ausgewaehlt';
$de3['SelDir'] = 'Waehlen Sie links das Zielverzeichnis aus';
$de3['TypeDir'] = 'Verzeichnisname eingeben';
$de3['TypeArq'] = 'Dateiname eingeben';
$de3['TypeCmd'] = 'Befehl eingeben';
$de3['TypeArqComp'] = 'Dateinamen eingeben.\\nDie Erweiterung definiert den
Archiv-Typ.\\nEx:\\nname.zip\\nname.tar\\nname.bzip\\nname.gzip';
$de3['RemSel'] = 'Entferne ausgewaehlte Objekte';
$de3['NoDestDir'] = 'Kein Zielverzeichnis ausgewaehlt';
$de3['DestEqOrig'] = 'Quelle und Zielverzeichnis sind gleich';
$de3['InvalidDest'] = 'Zielverzeichnis ungueltig';
$de3['NoNewPerm'] = 'Neue Rechte nicht gesetzt';
$de3['CopyTo'] = 'Kopiere nach';
$de3['MoveTo'] = 'Verschiebe nach';
$de3['AlterPermTo'] = 'Aendere Rechte zu';
$de3['ConfExec'] = 'Ausfuehren bestaetigen';
$de3['ConfRem'] = 'Entfernen bestaetigen';
$de3['EmptyDir'] = 'Leerer Ordner';
$de3['IOError'] = 'I/O Fehler';
$de3['FileMan'] = 'PHP Datei Manager';
$de3['TypePass'] = 'Bitte Passwort eingeben';
$de3['InvPass'] = 'Falsches Passwort';
$de3['ReadDenied'] = 'Kein Lesezugriff';
$de3['FileNotFound'] = 'Datei nicht gefunden';
$de3['AutoClose'] = 'Beenden bei Fertigstellung';
$de3['OutDocRoot'] = 'Datei ausserhalb des DOCUMENT_ROOT';
$de3['NoCmd'] = 'Fehler: unbekannter Befehl';
$de3['ConfTrySave'] = 'Datei ohne Schreibrecht.\\nVersuche dennoch zu speich
ern';
$de3['ConfSaved'] = 'Konfiguration gespeichert';
$de3['PassSaved'] = 'Passwort gespeichert';
$de3['FileDirExists'] = 'Datei oder Verzeichnis existiert bereits';
$de3['NoPhpinfo'] = 'Funktion phpinfo gesperrt';
$de3['NoReturn'] = 'kein zurueck';
$de3['FileSent'] = 'Datei gesendet';
$de3['SpaceLimReached'] = 'Speicherplatz Grenze erreicht';
$de3['InvExt'] = 'Ungueltige Erweiterung';
$de3['FileNoOverw'] = 'Datei konnte nicht ueberschrieben werden';
$de3['FileOverw'] = 'Datei ueberschrieben';
$fr1['Exec'] = 'Executer';
$fr1['Apply'] = 'Appliquer';
$fr1['StickyBit'] = 'Sticky Bit';
$fr1['Pass'] = 'Mot de passe';
$fr1['Lang'] = 'Langage';
$fr1['File'] = 'Fichier';
$fr1['File_s'] = 'fichier(s)';
$fr1['Dir_s'] = 'rpertoire(s)';
$fr1['To'] = '';
$fr1['Destination'] = 'Destination';
$fr1['Configurations'] = 'Configurations';
$fr1['JSError'] = 'Erreur JavaScript';
$fr1['NoSel'] = 'Rien n\'est slectionn';
$fr1['SelDir'] = 'Selectionnez le rpertoire de destination dans le panneau ga
uche';
$fr1['TypeDir'] = 'Entrer le nom du rpertoire';
$fr1['TypeArq'] = 'Entrer le nom du fichier';
$fr1['TypeCmd'] = 'Entrer la commande';
$fr1['TypeArqComp'] = 'Entrer le nom du fichier.\\nL\'extension dfinira le ty
pe de compression.\\nEx:\\nnome.zip\\nnome.tar\\nnome.bzip\\nnome.gzip';
$fr1['RemSel'] = 'EFFACER les objets slectionns';
$fr1['NoDestDir'] = 'Aucun rpertoire de destination n\'est slectionn';
$fr1['DestEqOrig'] = 'Les rpertoires source et destination sont identiques';
$fr1['InvalidDest'] = 'Le rpertoire de destination est invalide';
$fr1['NoNewPerm'] = 'Nouvelle permission non tablie';
$fr1['CopyTo'] = 'COPIER vers';
$fr1['MoveTo'] = 'DEPLACER vers';
$fr1['AlterPermTo'] = 'CHANGER LES PERMISSIONS';
$fr1['ConfExec'] = 'Confirmer l\'EXECUTION';
$fr1['ConfRem'] = 'Confirmer la DESTRUCTION';
$fr1['EmptyDir'] = 'Rpertoire vide';
$fr1['IOError'] = 'I/O Error';
$fr1['FileMan'] = 'PHP File Manager';
$fr1['TypePass'] = 'Entrer le mot de passe';
$fr1['InvPass'] = 'Mot de passe invalide';
$fr1['ReadDenied'] = 'Droit de lecture refus';
$fr1['FileNotFound'] = 'Fichier introuvable';
$fr1['AutoClose'] = 'Fermer sur fin';
$fr1['OutDocRoot'] = 'Fichier au del de DOCUMENT_ROOT';
$fr1['NoCmd'] = 'Erreur: Commande non renseigne';
$fr1['ConfTrySave'] = 'Fichier sans permission d\'criture.\\nJ\'essaie de l\'
enregister';
$fr1['ConfSaved'] = 'Configurations enreristre';
$fr1['PassSaved'] = 'Mot de passe enreristr';
$fr1['FileDirExists'] = 'Le fichier ou le rpertoire existe dj';
$fr1['NoPhpinfo'] = 'Function phpinfo dsactive';
$fr1['NoReturn'] = 'pas de retour';
$fr1['FileSent'] = 'Fichier envoy';
$fr1['SpaceLimReached'] = 'Espace maxi atteint';
$fr1['InvExt'] = 'Extension invalide';
$fr1['FileNoOverw'] = 'Le fichier ne peut pas etre cras';
$fr1['FileOverw'] = 'Fichier cras';
$fr1['FileIgnored'] = 'Fichier ignor';
$fr1['ChkVer'] = 'Verifier nouvelle version';
$fr1['ChkVerAvailable'] = 'Nouvelle version, cliquer ici pour la tlchager!!';
$fr1['ChkVerNotAvailable'] = 'Aucune mise a jour de disponible. :(';
$fr1['ChkVerError'] = 'Erreur de connection.';
$fr1['Website'] = 'siteweb';
$fr1['SendingForm'] = 'Envoi des fichiers en cours, Patienter';
$fr1['NoFileSel'] = 'Aucun fichier slectionn';
$fr1['SelAll'] = 'Tous';
$fr1['SelNone'] = 'Aucun';
$fr1['SelInverse'] = 'Inverser';
$fr1['Selected_s'] = 'selection';
$fr1['Total'] = 'total';
$fr1['Partition'] = 'Partition';
$fr1['RenderTime'] = 'Temps pour afficher cette page';
$fr1['Seconds'] = 'sec';
$fr1['ErrorReport'] = 'Rapport d\'erreur';
// French - by Sharky
$fr2['Version'] = 'Version';
$fr2['DocRoot'] = 'Racine document';
$fr2['FLRoot'] = 'Gestion des fichiers racine';
$fr2['Name'] = 'Nom';
$fr2['And'] = 'et';
$fr2['Enter'] = 'Entrer';
$fr2['Send'] = 'Envoi';
$fr2['Refresh'] = 'Rafrachir';
$fr2['SaveConfig'] = 'Sauver configurations';
$fr2['SavePass'] = 'Sauver mot de passe';
$fr2['SaveFile'] = 'Sauver fichier';
$fr2['Save'] = 'Sauver';
$fr2['Leave'] = 'Permission';
$fr2['Edit'] = 'diter';
$fr2['View'] = 'Afficher';
$fr2['Config'] = 'config';
$fr2['Ren'] = 'Renommer';
$fr2['Rem'] = 'Effacer';
$fr2['Compress'] = 'Compresser';
$fr2['Decompress'] = 'Dcompresser';
$fr2['ResolveIDs'] = 'Rsoudre ID';
$fr2['Move'] = 'Dplacer';
$fr2['Copy'] = 'Copier';
$fr2['ServerInfo'] = 'Information Serveur';
$fr2['CreateDir'] = 'Crer un rpertoire';
$fr2['CreateArq'] = 'Crer un fichier';
$fr2['ExecCmd'] = 'Execut une commande';
$fr2['Upload'] = 'Transfrer';
$fr2['UploadEnd'] = 'Transfert termin';
$fr2['Perm'] = 'Perm';
$fr2['Perms'] = 'Permissions';
$fr2['Owner'] = 'Propritaire';
$fr2['Group'] = 'Groupe';
$fr2['Other'] = 'Autre';
$fr2['Size'] = 'Taille';
$fr2['Date'] = 'date';
$fr2['Type'] = 'Type';
$fr2['Free'] = 'Libre';
$fr2['Shell'] = 'Shell';
$fr2['Read'] = 'lecture';
$fr2['Write'] = 'criture';
$fr2['Exec'] = 'Execute';
$fr2['Apply'] = 'Appliquer';
$fr2['StickyBit'] = 'Bit figer';
$fr2['Pass'] = 'mot de passe';
$fr2['Lang'] = 'Language';
$fr2['File'] = 'Fichier';
$fr2['File_s'] = 'fichier(s)';
$fr2['Dir_s'] = 'rpertoire(s)';
$fr2['To'] = '';
$fr2['Destination'] = 'Destination';
$fr2['Configurations'] = 'Configurations';
$fr2['JSError'] = 'Erreur JavaScript';
$fr2['NoSel'] = 'Il n\'y a pas d\'objets slectionns';
$fr2['SelDir'] = 'Slectionnez le rpertoire de destination sur l\'arborescence
de gauche';
$fr2['TypeDir'] = 'Entrez le nom du rpertoire';
$fr2['TypeArq'] = 'Entrez le nom du fichier';
$fr2['TypeCmd'] = 'Entrez la commande';
$fr2['TypeArqComp'] = 'Entrez le fichier.\\nL\'extension dfinira le type de c
ompression.\\nEx:\\nnom.zip\\nnom.tar\\nnom.bzip\\nnom.gzip';
$fr2['RemSel'] = 'EFFACEZ l\'objet slectionn';
$fr2['NoDestDir'] = 'Il n\'y a aucun rpertoire de destination slectionn';
$fr2['DestEqOrig'] = 'Origine et rpertoires de destination sont identique';
$fr2['InvalidDest'] = 'Rpertoire de destination est invalide';
$fr2['NoNewPerm'] = 'Nouvelle autorisation n\'a pas t configur';
$fr2['CopyTo'] = 'COPIE dans';
$fr2['MoveTo'] = 'DPLACER dans';
$fr2['AlterPermTo'] = 'CHANGER PERMISSIONS dans';
$fr2['ConfExec'] = 'Confirmer EXECUTE';
$fr2['ConfRem'] = 'Confirmer EFFACER';
$fr2['EmptyDir'] = 'Rpertoire vide';
$fr2['IOError'] = 'I/O Erreur';
$fr2['FileMan'] = 'Gestion de fichiers PHP';
$fr2['TypePass'] = 'Entrer le mot de passe';
$fr2['InvPass'] = 'Mot de passe invalide';
$fr2['ReadDenied'] = 'Accs en lecture refuser';
$fr2['FileNotFound'] = 'Fichier non-trouv';
$fr2['AutoClose'] = 'Fermez a la fin';
$fr2['OutDocRoot'] = 'Fichier au-del DOCUMENT_ROOT';
$fr2['NoCmd'] = 'Erreur: Commande inconnue';
$fr2['ConfTrySave'] = 'Fichier sans permission d\'criture.\\nEssayez de sauve
r';
$fr2['ConfSaved'] = 'Configurations sauve';
$fr2['PassSaved'] = 'Mot de passe sauv';
$fr2['FileDirExists'] = 'Fichier ou rpertoire dj existant';
$fr2['NoPhpinfo'] = 'Function phpinfo dsactiv';
$fr2['NoReturn'] = 'sans retour possible';
$fr2['FileSent'] = 'Fichier envoy';
$fr2['SpaceLimReached'] = 'Limite de d\'espace atteint';
$fr2['InvExt'] = 'Extension invalide';
$fr2['FileNoOverw'] = 'Fichier ne peut pas tre cras';
$fr2['FileOverw'] = 'Fichier cras';
$fr2['FileIgnored'] = 'Fichier ignor';
$fr2['ChkVer'] = 'Check nouvelle version';
$fr2['ChkVerAvailable'] = 'Nouvelle version, cliquez ici pour commencer le tlc
hargement!!';
$fr2['ChkVerNotAvailable'] = 'Aucune nouvelle version disponible. :(';
$fr2['ChkVerError'] = 'Erreur de connection.';
$fr2['Website'] = 'Site Web';
$fr2['SendingForm'] = 'Envoye de fichier, s\'il vous plat patientez';
$fr2['NoFileSel'] = 'Aucun fichier slectionn';
$fr2['SelAll'] = 'Tout';
$fr2['SelNone'] = 'Aucuns';
$fr2['SelInverse'] = 'Inverser';
$fr2['Selected_s'] = 'slectionn';
$fr2['Total'] = 'total';
$fr2['Partition'] = 'Partition';
$fr2['RenderTime'] = 'Temps pour afficher la page';
$fr2['Seconds'] = 'sec';
$fr2['ErrorReport'] = 'Liste des erreurs';
// French - by Michel Lainey
$fr3['Version'] = 'Version';
$fr3['DocRoot'] = 'Racine Document';
$fr3['FLRoot'] = 'Racine File Manager';
$fr3['Name'] = 'Nom';
$fr3['And'] = 'et';
$fr3['Enter'] = 'Valider';
$fr3['Send'] = 'Envoyer';
$fr3['Refresh'] = 'Raffraichir';
$fr3['SaveConfig'] = 'Sauvegarder Config';
$fr3['SavePass'] = 'Sauvegarder Password';
$fr3['SaveFile'] = 'Sauvegarder Fichier';
$fr3['Save'] = 'Sauvegarder';
$fr3['Leave'] = 'Quitter';
$fr3['Edit'] = 'Editer';
$fr3['View'] = 'Visualiser';
$fr3['Config'] = 'Config';
$fr3['Ren'] = 'Renommer';
$fr3['Rem'] = 'Supprimer';
$fr3['Compress'] = 'Compresser';
$fr3['Decompress'] = 'Dcompresser';
$fr3['ResolveIDs'] = 'Resoudre IDs';
$fr3['Move'] = 'Dplacer';
$fr3['Copy'] = 'Copier';
$fr3['ServerInfo'] = 'Server Info';
$fr3['CreateDir'] = 'Crer Rpertoire';
$fr3['CreateArq'] = 'Crer Fichier';
$fr3['ExecCmd'] = 'Executer Commande';
$fr3['Upload'] = 'Upload';
$fr3['UploadEnd'] = 'Upload Fini';
$fr3['Perm'] = 'Perm';
$fr3['Perms'] = 'Permissions';
$fr3['Owner'] = 'Propritaire';
$fr3['Group'] = 'Groupe';
$fr3['Other'] = 'Autres';
$fr3['Size'] = 'Taille';
$fr3['Date'] = 'Date';
$fr3['Type'] = 'Type';
$fr3['Free'] = 'libre';
$fr3['Shell'] = 'Shell';
$fr3['Read'] = 'Lecture';
$fr3['Write'] = 'Ecriture';
$fr3['Exec'] = 'Execute';
$fr3['Apply'] = 'Application';
$fr3['StickyBit'] = 'Sticky Bit';
$fr3['Pass'] = 'Password';
$fr3['Lang'] = 'Language';
$fr3['File'] = 'Fichier';
$fr3['File_s'] = 'fichier(s)';
$fr3['Dir_s'] = 'rpertoire(s)';
$fr3['To'] = '';
$fr3['Destination'] = 'Destination';
$fr3['Configurations'] = 'Configurations';
$fr3['JSError'] = 'Erreur JavaScript';
$fr3['NoSel'] = 'Aucun lment slectionn';
$fr3['SelDir'] = "Slectionner le rpertoire de destination dans l'arboresence d
e gauchethe destination directory on the left tree";
$nl['Name'] = 'Naam';
$nl['And'] = 'en';
$nl['Enter'] = 'Enter';
$nl['Send'] = 'Verzend';
$nl['Refresh'] = 'Vernieuw';
$nl['SaveConfig'] = 'Configuratie opslaan';
$nl['SavePass'] = 'Wachtwoord opslaan';
$nl['SaveFile'] = 'Bestand opslaan';
$nl['Save'] = 'Opslaan';
$nl['Leave'] = 'Verlaten';
$nl['Edit'] = 'Wijzigen';
$nl['View'] = 'Toon';
$nl['Config'] = 'Configuratie';
$nl['Ren'] = 'Naam wijzigen';
$nl['Rem'] = 'Verwijderen';
$nl['Compress'] = 'Comprimeren';
$nl['Decompress'] = 'Decomprimeren';
$nl['ResolveIDs'] = 'Resolve IDs';
$nl['Move'] = 'Verplaats';
$nl['Copy'] = 'Kopieer';
$nl['ServerInfo'] = 'Serverinformatie';
$nl['CreateDir'] = 'Nieuwe map';
$nl['CreateArq'] = 'Nieuw bestand';
$nl['ExecCmd'] = 'Commando uitvoeren';
$nl['Upload'] = 'Upload';
$nl['UploadEnd'] = 'Upload voltooid';
$nl['Perm'] = 'Rechten';
$nl['Perms'] = 'Rechten';
$nl['Owner'] = 'Eigenaar';
$nl['Group'] = 'Groep';
$nl['Other'] = 'Anderen';
$nl['Size'] = 'Grootte';
$nl['Date'] = 'Datum';
$nl['Type'] = 'Type';
$nl['Free'] = 'free';
$nl['Shell'] = 'Shell';
$nl['Read'] = 'Lezen';
$nl['Write'] = 'Schrijven';
$nl['Exec'] = 'Uitvoeren';
$nl['Apply'] = 'Toepassen';
$nl['StickyBit'] = 'Sticky Bit';
$nl['Pass'] = 'Wachtwoord';
$nl['Lang'] = 'Taal';
$nl['File'] = 'Bestand';
$nl['File_s'] = 'bestand(en)';
$nl['Dir_s'] = 'map(pen)';
$nl['To'] = 'naar';
$nl['Destination'] = 'Bestemming';
$nl['Configurations'] = 'Instellingen';
$nl['JSError'] = 'Javascriptfout';
$nl['NoSel'] = 'Er zijn geen bestanden geselecteerd';
$nl['SelDir'] = 'Kies de bestemming in de boom aan de linker kant';
$nl['TypeDir'] = 'Voer de mapnaam in';
$nl['TypeArq'] = 'Voer de bestandsnaam in';
$nl['TypeCmd'] = 'Voer het commando in';
$nl['TypeArqComp'] = 'Voer de bestandsnaam in.\\nDe extensie zal het com
pressietype bepalen.\\nEx:\\nnome.zip\\nnome.tar\\nnome.bzip\\nnome.gzip';
$nl['RemSel'] = 'VERWIJDER geselecteerde itens';
$nl['NoDestDir'] = 'Er is geen doelmap geselecteerd';
$nl['DestEqOrig'] = 'Bron- en doelmap zijn hetzelfde';
$it1['Save'] = 'Salva';
$it1['Leave'] = 'Abbandona';
$it1['Edit'] = 'Modifica';
$it1['View'] = 'Guarda';
$it1['Config'] = 'Configurazione';
$it1['Ren'] = 'Rinomina';
$it1['Rem'] = 'Elimina';
$it1['Compress'] = 'Comprimi';
$it1['Decompress'] = 'Decomprimi';
$it1['ResolveIDs'] = 'Risolvi IDs';
$it1['Move'] = 'Sposta';
$it1['Copy'] = 'Copia';
$it1['ServerInfo'] = 'Informazioni sul Server';
$it1['CreateDir'] = 'Crea Directory';
$it1['CreateArq'] = 'Crea File';
$it1['ExecCmd'] = 'Esegui Comando';
$it1['Upload'] = 'Carica';
$it1['UploadEnd'] = 'Caricamento terminato';
$it1['Perm'] = 'Perm';
$it1['Perms'] = 'Permessi';
$it1['Owner'] = 'Proprietario';
$it1['Group'] = 'Gruppo';
$it1['Other'] = 'Altri';
$it1['Size'] = 'Dimensioni';
$it1['Date'] = 'Data';
$it1['Type'] = 'Tipo';
$it1['Free'] = 'liberi';
$it1['Shell'] = 'Shell';
$it1['Read'] = 'Lettura';
$it1['Write'] = 'Scrittura';
$it1['Exec'] = 'Esecuzione';
$it1['Apply'] = 'Applica';
$it1['StickyBit'] = 'Sticky Bit';
$it1['Pass'] = 'Password';
$it1['Lang'] = 'Lingua';
$it1['File'] = 'File';
$it1['File_s'] = 'file';
$it1['Dir_s'] = 'directory';
$it1['To'] = 'a';
$it1['Destination'] = 'Destinazione';
$it1['Configurations'] = 'Configurazione';
$it1['JSError'] = 'Errore JavaScript';
$it1['NoSel'] = 'Non ci sono elementi selezionati';
$it1['SelDir'] = 'Scegli la directory di destinazione';
$it1['TypeDir'] = 'Inserisci il nome della directory';
$it1['TypeArq'] = 'Inserisci il nome del file';
$it1['TypeCmd'] = 'Inserisci il comando';
$it1['TypeArqComp'] = 'Inserisci il nome del file.\\nLa estensione definir il
tipo di compressione.\\nEsempio:\\nnome.zip\\nnome.tar\\nnome.bzip\\nnome.gzip'
sa';
';
$it2['Rem'] = 'Cancella';
$it2['Compress'] = 'Comprimi';
$it2['Decompress'] = 'Decomprimi';
$it2['ResolveIDs'] = 'Risolvi ID';
$it2['Move'] = 'Muovi';
$it2['Copy'] = 'Copia';
$it2['ServerInfo'] = 'Server info';
$it2['CreateDir'] = 'Crea cartella';
$it2['CreateArq'] = 'Crea file';
$it2['ExecCmd'] = 'Esegui comando';
$it2['Upload'] = 'Upload';
$it2['UploadEnd'] = 'Upload terminato';
$it2['Perm'] = 'Perm';
$it2['Perms'] = 'Permessi';
$it2['Owner'] = 'Owner';
$it2['Group'] = 'Grouppo';
$it2['Other'] = 'Altro';
$it2['Size'] = 'Dimensione';
$it2['Date'] = 'Data';
$it2['Type'] = 'Tipo';
$it2['Free'] = 'liberi';
$it2['Shell'] = 'Shell';
$it2['Read'] = 'Lettura';
$it2['Write'] = 'Scrittura';
$it2['Exec'] = 'Esecuzione';
$it2['Apply'] = 'Applica';
$it2['StickyBit'] = 'Sticky Bit';
$it2['Pass'] = 'Password';
$it2['Lang'] = 'Lingua';
$it2['File'] = 'File';
$it2['File_s'] = 'file';
$it2['Dir_s'] = 'cartella';
$it2['To'] = 'a';
$it2['Destination'] = 'Destinazione';
$it2['Configurations'] = 'Configurazioni';
$it2['JSError'] = 'Errore JavaScript';
$it2['NoSel'] = 'Nessun item selezionato';
$it2['SelDir'] = 'Scegli la cartella di destinazione sull\'albero a sinistra
';
arlo comunque';
$it3['ConfSaved'] = 'Configurazione salvata';
$it3['PassSaved'] = 'Password salvata';
$it3['FileDirExists'] = 'Il file o la cartella esiste già';
$it3['NoPhpinfo'] = 'Funzione phpinfo disabilitata';
$it3['NoReturn'] = 'no return';
$it3['FileSent'] = 'File inviato';
$it3['SpaceLimReached'] = 'Limite di spazio raggiunto';
$it3['InvExt'] = 'Estensione non valida';
$it3['FileNoOverw'] = 'Il file non può essere sovrascritto';
$it3['FileOverw'] = 'File sovrascritto';
$it3['FileIgnored'] = 'File ignorato';
$it3['ChkVer'] = 'Controlla la presnza di una nuova versione';
$it3['ChkVerAvailable'] = 'Nuova versione, clicca qui per avviare il downloa
d!!';
$it3['ChkVerNotAvailable'] = 'Nessuna nuova versione disponibile. :(';
$it3['ChkVerError'] = 'Errore di connessione.';
$it3['Website'] = 'Sito';
$it3['SendingForm'] = 'Invio dei file, attendi';
$it3['NoFileSel'] = 'Nessun file selezionato';
$it3['SelAll'] = 'Tutti';
$it3['SelNone'] = 'Nessuno';
$it3['SelInverse'] = 'Inverti selezione';
$it3['Selected_s'] = 'selezionato';
$it3['Total'] = 'totale';
$it3['Partition'] = 'Partizione';
$it3['RenderTime'] = 'Tempo di generazione';
$it3['Seconds'] = 'sec';
$it3['ErrorReport'] = 'Error Reporting';
// Italian - by Gianni
$it4['Version'] = 'Versione';
$it4['DocRoot'] = 'Root documenti';
$it4['FLRoot'] = 'Root file manager';
$it4['Name'] = 'Nome';
$it4['And'] = 'e';
$it4['Enter'] = 'Entra';
$it4['Send'] = 'Invia';
$it4['Refresh'] = 'Aggiorna';
$it4['SaveConfig'] = 'Salva configurazioni';
$it4['SavePass'] = 'Salva password';
$it4['SaveFile'] = 'Salva file';
$it4['Save'] = 'Salva';
$it4['Leave'] = 'Esci';
$it4['Edit'] = 'Modifica';
$it4['View'] = 'Vedi';
$it4['Config'] = 'Preferenze';
$it4['Ren'] = 'Rinomina';
$it4['Rem'] = 'Cancella';
$it4['Compress'] = 'Comprimi';
$it4['Decompress'] = 'Decomprimi';
$it4['ResolveIDs'] = 'Risolvi IDs';
$it4['Move'] = 'Sposta';
$it4['Copy'] = 'Copia';
$it4['ServerInfo'] = 'Versione PHP';
$it4['CreateDir'] = 'Crea directory';
$it4['CreateArq'] = 'Crea file';
$it4['ExecCmd'] = 'Esegui comando';
$it4['Upload'] = 'Upload';
$it4['UploadEnd'] = 'Upload terminato';
$it4['Perm'] = 'Perm';
$it4['Perms'] = 'Permessi';
$it4['Owner'] = 'Proprietario';
$it4['Group'] = 'Gruppo';
$it4['Other'] = 'Altro';
$it4['Size'] = 'Dimensione';
$it4['Date'] = 'Data';
$it4['Type'] = 'Tipo';
$it4['Free'] = 'liberi';
$it4['Shell'] = 'Shell';
$it4['Read'] = 'Lettura';
$it4['Write'] = 'Scrittura';
$it4['Exec'] = 'Esecuzione';
$it4['Apply'] = 'Applica';
$it4['StickyBit'] = 'Sticky Bit';
$it4['Pass'] = 'Password';
$it4['Lang'] = 'Lingua';
$it4['File'] = 'File';
$it4['File_s'] = 'files';
$it4['Dir_s'] = 'directory';
$it4['To'] = 'in';
$it4['Destination'] = 'Destinazione';
$it4['Configurations'] = 'Preferenze';
$it4['JSError'] = 'Errore JavaScript';
$it4['NoSel'] = 'Non ci sono elementi selezionati';
$it4['SelDir'] = 'Seleziona una directory di destinazione a sinistra';
$it4['TypeDir'] = 'Inserisci il nome della directory';
$it4['TypeArq'] = 'Inserisci il nome del file';
$it4['TypeCmd'] = 'Inserisci il comando';
$it4['TypeArqComp'] = 'Inserisci il nome del file e tipo di compressione\\n(
.Zip .Tar .Bzip .Gzip)';
$it4['RemSel'] = 'Cancella gli elementi selezionati';
$it4['NoDestDir'] = 'Seleziona una directory di destinazione';
$it4['DestEqOrig'] = 'Origine e destinazione sono uguali';
$it4['InvalidDest'] = 'Directory di destinazione non valida';
$it4['NoNewPerm'] = 'Nuovi permessi non impostati';
$it4['CopyTo'] = 'Copia in';
$it4['MoveTo'] = 'Sposta in';
$it4['AlterPermTo'] = 'Cambia permessi in';
$it4['ConfExec'] = 'Conferma esecuzione';
$it4['ConfRem'] = 'Conferma eliminazione';
$it4['EmptyDir'] = 'Directory Vuota';
$it4['IOError'] = 'Errore I/O';
$it4['FileMan'] = 'PHP File Manager';
$it4['TypePass'] = 'Inserisci la password';
$it4['InvPass'] = 'Password non valida';
$it4['ReadDenied'] = 'Accesso in lettura negato';
$it4['FileNotFound'] = 'File non trovato';
$it4['AutoClose'] = 'Chiudi al termine';
$it4['OutDocRoot'] = 'File fuori dalla Root documenti';
$it4['NoCmd'] = 'Errore: comando non informato';
$it4['ConfTrySave'] = 'File senza permessi di scrittura.\\nRiprova a salvare
';
$it4['ConfSaved'] = 'Preferenze salvate';
$it4['PassSaved'] = 'Password salvata';
$it4['FileDirExists'] = 'Il file o la directory esistono gi';
$it4['NoPhpinfo'] = 'Funzione phpinfo disabilitata';
$it4['NoReturn'] = 'Nessun ritorno';
$it4['FileSent'] = 'File inviato';
$it4['SpaceLimReached'] = 'Raggiunto spazio limite';
$tr['Free'] = 'Bos';
$tr['Shell'] = 'Kabuk';
$tr['Read'] = 'Oku';
$tr['Write'] = 'Yaz';
$tr['Exec'] = 'Calistir';
$tr['Apply'] = 'Uygula';
$tr['StickyBit'] = 'Sabit bit';
$tr['Pass'] = 'Parola';
$tr['Lang'] = 'Dil';
$tr['File'] = 'Dosya';
$tr['File_s'] = 'Dosya(lar)';
$tr['Dir_s'] = 'Dizin(ler)';
$tr['To'] = 'icin';
$tr['Destination'] = 'Hedef';
$tr['Configurations'] = 'Yapilandirmalar';
$tr['JSError'] = 'JavaScript hatasi';
$tr['NoSel'] = 'Secilen oge yok';
$tr['SelDir'] = 'Soldaki hedef dizin agaci secin';
$tr['TypeDir'] = 'Dizin adini girin';
$tr['TypeArq'] = 'Dosya adini girin';
$tr['TypeCmd'] = 'Komut girin';
$tr['TypeArqComp'] = 'Dosya ismini yazdiktan sonra sonuna .zip ekleyin';
$tr['RemSel'] = 'Secili ogeleri sil';
$tr['NoDestDir'] = 'Secili dizin yok';
$tr['DestEqOrig'] = 'Kokenli ve esit gidis rehberi';
$tr['InvalidDest'] = 'Hedef dizin gecersiz';
$tr['NoNewPerm'] = 'Izinler uygun degil';
$tr['CopyTo'] = 'Kopya icin';
$tr['MoveTo'] = 'Tasi icin';
$tr['AlterPermTo'] = 'Permission secin';
$tr['ConfExec'] = 'Yapilandirmayi onayla';
$tr['ConfRem'] = 'Simeyi onayla';
$tr['EmptyDir'] = 'Dizin bos';
$tr['IOError'] = 'Hata';
$tr['FileMan'] = 'Necdet_Yazilimlari';
$tr['TypePass'] = 'Parolayi girin';
$tr['InvPass'] = 'Gecersiz parola';
$tr['ReadDenied'] = 'Okumaya erisim engellendi';
$tr['FileNotFound'] = 'Dosya bulunamadi';
$tr['AutoClose'] = 'Otomatik kapat';
$tr['OutDocRoot'] = 'Kok klasor disindaki dosya';
$tr['NoCmd'] = 'Hata: Komut haberdar degil';
$tr['ConfTrySave'] = 'Dosya yazma izniniz yok. Yine de kaydetmeyi deneyebili
rsiniz.';
$tr['ConfSaved'] = 'Ayarlar kaydedildi';
$tr['PassSaved'] = 'Parola kaydedildi';
$tr['FileDirExists'] = 'Dosya veya dizin zaten var';
$tr['NoPhpinfo'] = 'Php fonksiyon bilgisi devre disi';
$tr['NoReturn'] = 'Deger dondurmuyor';
$tr['FileSent'] = 'Dosya gonderildi';
$tr['SpaceLimReached'] = 'Disk limitine ulasildi';
$tr['InvExt'] = 'Gecersiz uzanti';
$tr['FileNoOverw'] = 'Dosya degistirilemiyor';
$tr['FileOverw'] = 'Dosya degistiribiliyor';
$tr['FileIgnored'] = 'Dosya kabul edildi';
$tr['ChkVer'] = 'Yeni versiyonu kontrol et';
$tr['ChkVerAvailable'] = 'Yeni surum bulundu. Indirmek icin buraya tiklayin.
';
$tr['ChkVerNotAvailable'] = 'Yeni surum bulunamadi.';
$tr['ChkVerError'] = 'Baglanti hatasi';
$tr['Website'] = 'Website';
$tr['SendingForm'] = 'Dosyalar gonderiliyor, lutfen bekleyin';
$tr['NoFileSel'] = 'Secili dosya yok';
$tr['SelAll'] = 'Hepsi';
$tr['SelNone'] = 'Hicbiri';
$tr['SelInverse'] = 'Ters';
$tr['Selected_s'] = 'Secili oge(ler)';
$tr['Total'] = 'Toplam';
$tr['Partition'] = 'Bolme';
$tr['RenderTime'] = 'Olusturuluyor';
$tr['Seconds'] = 'Saniye';
$tr['ErrorReport'] = 'Hata raporu';
// -
$ru['Version']='';
$ru['DocRoot']=' Root ';
$ru['FLRoot']=' ';
$ru['Name']='';
$ru['And']='';
$ru['Enter']='Enter';
$ru['Send']='';
$ru['Refresh']='';
$ru['SaveConfig']=' ';
$ru['SavePass']=' ';
$ru['SaveFile']=' ';
$ru['Save']='';
$ru['Leave']='';
$ru['Edit']='';
$ru['View']='';
$ru['Config']='';
$ru['Ren']='';
$ru['Rem']='';
$ru['Compress']='';
$ru['Decompress']='';
$ru['ResolveIDs']=' id';
$ru['Move']='';
$ru['Copy']='';
$ru['ServerInfo']=' ';
$ru['CreateDir']=' ';
$ru['CreateArq']=' ';
$ru['ExecCmd']='';
$ru['Upload']='';
$ru['UploadEnd']='';
$ru['Perm']='';
$ru['Perms']='';
$ru['Owner']='';
$ru['Group']='';
$ru['Other']='';
$ru['Size']='';
$ru['Date']='';
$ru['Type']='';
$ru['Free']='';
$ru['Shell']='Shell';
$ru['Read']='';
$ru['Write']='';
$ru['Exec']='';
$ru['Apply']='';
$ru['StickyBit']='StickyBit';
$ru['Pass']='';
$ru['Lang']='';
$ru['File']='';
$ru['File_s']='..';
$ru['Dir_s']='..';
$ru['To']='';
$ru['Destination']='';
$ru['Configurations']='';
$ru['JSError']=' JavaScript';
$ru['NoSel']=' ';
$ru['SelDir']=' ';
$ru['TypeDir']=' ';
$ru['TypeArq']=' ';
$ru['TypeCmd']=' ';
$ru['TypeArqComp']=' ,\\n
$ru['RemSel']=' ';
$ru['NoDestDir']=' ';
$ru['DestEqOrig']=' ';
$ru['InvalidDest']=' ';
$ru['NoNewPerm']=' ';
$ru['CopyTo']=' ';
$ru['MoveTo']=' ';
$ru['AlterPermTo']=' ';
$ru['ConfExec']=' ';
$ru['ConfRem']=' ';
$ru['EmptyDir']=' ';
$ru['IOError']='I/O Error';
$ru['FileMan']='PHP ';
$ru['TypePass']=' ';
$ru['InvPass']=' ';
$ru['ReadDenied']=' ';
$ru['FileNotFound']=' ';
$ru['AutoClose']=' ';
$ru['OutDocRoot']=' DOCUMENT_ROOT';
$ru['NoCmd']=': ';
$ru['ConfTrySave']=' . \\n . ';
$ru['ConfSaved']=' ';
$ru['PassSaved']=' ';
$ru['FileDirExists']=' ';
$ru['NoPhpinfo']=' PHPInfo ';
$ru['NoReturn']=' ';
$ru['FileSent']=' ';
$ru['SpaceLimReached']=' ';
$ru['InvExt']=' ';
$ru['FileNoOverw']=' ';
$ru['FileOverw']=' ';
$ru['FileIgnored']=' ';
$ru['ChkVer']=' ';
$ru['ChkVerAvailable']=' , ,
$ru['ChkVerNotAvailable']=' . :(';
$ru['ChkVerError']=' . ';
$ru['Website']='';
$ru['SendingForm']=' , , ';
$ru['NoFileSel']=' ';
$ru['SelAll']=' ';
$ru['SelNone']='';
$ru['SelInverse']='';
$ru['Selected_s']='';
$ru['Total']='';
$ru['Partition']='';
$ru['RenderTime']=' ';
$ru['Seconds']='';
$ru['ErrorReport']=' ';
// Catalan - by Pere Borrs AKA @Norl
$cat['Version'] = 'Versi';
$cat['DocRoot'] = 'Arrel del programa';
$cat['FLRoot'] = 'Arrel de l administrador d arxius';
$cat['Name'] = 'Nom';
$cat['And'] = 'i';
$cat['Enter'] = 'Entrar';
$cat['Send'] = 'Enviar';
$cat['Refresh'] = 'Refrescar';
$cat['SaveConfig'] = 'Desar configuracions';
$cat['SavePass'] = 'Desar clau';
$cat['SaveFile'] = 'Desar Arxiu';
$cat['Save'] = 'Desar';
$cat['Leave'] = 'Sortir';
$cat['Edit'] = 'Editar';
$cat['View'] = 'Mirar';
$cat['Config'] = 'Config.';
$cat['Ren'] = 'Canviar nom';
$cat['Rem'] = 'Esborrar';
$cat['Compress'] = 'Comprimir';
$cat['Decompress'] = 'Descomprimir';
$cat['ResolveIDs'] = 'Resoldre IDs';
$cat['Move'] = 'Moure';
$cat['Copy'] = 'Copiar';
$cat['ServerInfo'] = 'Info del Server';
$cat['CreateDir'] = 'Crear Directori';
$cat['CreateArq'] = 'Crear Arxiu';
$cat['ExecCmd'] = 'Executar Comandament';
$cat['Upload'] = 'Pujar';
$cat['UploadEnd'] = 'Pujat amb xit';
$cat['Perm'] = 'Perm';
$cat['Perms'] = 'Permisos';
$cat['Owner'] = 'Propietari';
$cat['Group'] = 'Grup';
$cat['Other'] = 'Altre';
$cat['Size'] = 'Tamany';
$cat['Date'] = 'Data';
$cat['Type'] = 'Tipus';
$cat['Free'] = 'lliure';
$cat['Shell'] = 'Executar';
$cat['Read'] = 'Llegir';
$cat['Write'] = 'Escriure';
$cat['Exec'] = 'Executar';
$cat['Apply'] = 'Aplicar';
$cat['StickyBit'] = 'Sticky Bit';
$cat['Pass'] = 'Clau';
$cat['Lang'] = 'Llenguatje';
$cat['File'] = 'Arxius';
$cat['File_s'] = 'arxiu(s)';
$cat['Dir_s'] = 'directori(s)';
$cat['To'] = 'a';
$cat['Destination'] = 'Dest';
$cat['Configurations'] = 'Configuracions';
$cat['JSError'] = 'Error de JavaScript';
$cat['NoSel'] = 'No hi ha items seleccionats';
$cat['SelDir'] = 'Seleccioneu el directori de dest a l arbre de la dreta';
$cat['TypeDir'] = 'Escrigui el nom del directori';
$cat['TypeArq'] = 'Escrigui el nom de l arxiu';
}
// +-------------------------------------------------// | 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,0755);
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,0755);
$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 $current_dir,$filename;
$file = $current_dir.$filename;
if(file_exists($file)){
$is_denied = false;
foreach($download_ext_filter as $key=>$ext){
if (eregi($ext,$filename)){
$is_denied = true;
break;
}
}
if (!$is_denied){
$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_cmd(){
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 execute_file(){
global $current_dir,$filename;
header("Content-type: text/plain");
$file = $current_dir.$filename;
if(file_exists($file)){
echo " ".$file."\n";
exec($file,$mat);
if (count($mat)) echo trim(implode("\n",$mat));
} else alert(et('FileNotFound').": ".$file);
}
function save_upload($temp_file,$filename,$dir_dest) {
global $upload_ext_filter;
$filename = remove_special_chars($filename);
$file = $dir_dest.$filename;
$filesize = filesize($temp_file);
$is_denied = false;
foreach($upload_ext_filter as $key=>$ext){
if (eregi($ext,$filename)){
$is_denied = true;
break;
}
}
if (!$is_denied){
if (!check_limit($filesize)){
if (file_exists($file)){
if (unlink($file)){
if (copy($temp_file,$file)){
@chmod($file,0755);
$out = 6;
} else $out = 2;
} else $out = 5;
} else {
if (copy($temp_file,$file)){
@chmod($file,0755);
$out = 1;
} else $out = 2;
}
} else $out = 3;
} else $out = 4;
return $out;
}
function zip_extract(){
global $cmd_arg,$current_dir,$islinux;
$zip = zip_open($current_dir.$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($current_dir.$tmp, 0755);
}
}
}
if (zip_entry_open($zip, $zip_entry, "r")) {
if ($fd = fopen($current_dir.$complete_name, 'w')){
fwrite($fd, zip_entry_read($zip_entry, zip_entry_filesize($z
ip_entry)));
fclose($fd);
} else echo "fopen($current_dir.$complete_name) error<br>";
zip_entry_close($zip_entry);
} else echo "zip_entry_open($zip,$zip_entry) error<br>";
}
}
zip_close($zip);
}
}
// +-------------------------------------------------// | Data Formating
// +-------------------------------------------------function html_encode($str){
global $charSet;
$str = preg_replace(array('/&/', '/</', '/>/', '/"/'), array('&', '&
lt;', '>', '"'), $str); // Bypass PHP to allow any charset!!
$str = htmlentities($str, ENT_QUOTES, $charSet, false);
return $str;
}
function rep($x,$y){
if ($x) {
$aux = "";
for ($a=1;$a<=$x;$a++) $aux .= $y;
return $aux;
} else return "";
}
function str_zero($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);
}
function remove_special_chars($str){
$str = trim($str);
$str = strtr($str,"!@&*
"YuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooou
uuuyy_______________");
$str = str_replace("..","",str_replace("/","",str_replace("\\","",str_replac
e("\$","",$str))));
return $str;
}
function format_path($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( $P ) {
$sP = "<b>";
if($P & 0x1000) $sP .= 'p';
// FIFO pipe
elseif($P & 0x2000) $sP .= 'c';
// Character special
elseif($P & 0x4000) $sP .= 'd';
// Directory
elseif($P & 0x6000) $sP .= 'b';
// Block special
elseif($P & 0x8000) $sP .= '−'; // Regular
elseif($P & 0xA000) $sP .= 'l';
// Symbolic Link
}
function lowercase($str){
global $charset;
return mb_strtolower($str, $charset);
}
// +-------------------------------------------------// | Interface
// +-------------------------------------------------function html_header($header=""){
global $charset,$fm_color;
echo "
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http:
//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=".$charset."\
" />
<title>...:::: ".et('FileMan')."</title>
<script language=\"Javascript\" type=\"text/javascript\">
<!-function Is(){
this.appname = navigator.appName;
this.appversion = navigator.appVersion;
this.platform = navigator.platform;
this.useragent = navigator.userAgent.toLowerCase();
this.ie = ( this.appname == 'Microsoft Internet Explorer' );
if (( this.useragent.indexOf( 'mac' ) != -1 ) || ( this.platform.ind
exOf( 'mac' ) != -1 )){
this.sisop = 'mac';
} else if (( this.useragent.indexOf( 'windows' ) != -1 ) || ( this.p
latform.indexOf( 'win32' ) != -1 )){
this.sisop = 'windows';
} else if (( this.useragent.indexOf( 'inux' ) != -1 ) || ( this.plat
form.indexOf( 'linux' ) != -1 )){
this.sisop = 'linux';
}
}
var is = new Is();
function enterSubmit(keypressEvent,submitFunc){
var kCode = (is.ie) ? keypressEvent.keyCode : keypressEvent.which
if( kCode == 13) eval(submitFunc);
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (';', offset);
if (endstr == -1) endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function getCookie (name) {
var arg = name + '=';
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg) return getCookieVal
(j);
i = document.cookie.indexOf(' ', i) + 1;
if (i == 0) break;
}
return null;
}
function setCookie (name, value, expires) {
var argv = setCookie.arguments;
var argc = setCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + '=' + escape (value) +
((expires == null) ? '' : ('; expires=' + expires.toGMTString())) +
((path == null) ? '' : ('; path=' + path)) +
((domain == null) ? '' : ('; domain=' + domain)) +
((secure == true) ? '; secure' : '');
}
function delCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = getCookie (name);
document.cookie = name + '=' + cval + '; expires=' + exp.toGMTString
();
}
var frameWidth, frameHeight;
function getFrameSize(){
if (self.innerWidth){
frameWidth = self.innerWidth;
frameHeight = self.innerHeight;
}else if (document.documentElement && document.documentElement.clien
tWidth){
frameWidth = document.documentElement.clientWidth;
frameHeight = document.documentElement.clientHeight;
}else if (document.body){
frameWidth = document.body.clientWidth;
frameHeight = document.body.clientHeight;
}else return false;
return true;
}
getFrameSize();
//-->
</script>
$header
</head>
<script language=\"Javascript\" type=\"text/javascript\">
<!-var W = screen.width;
var H = screen.height;
var FONTSIZE = 0;
switch (W){
case 640:
FONTSIZE = 8;
break;
case 800:
FONTSIZE = 10;
break;
case 1024:
FONTSIZE = 12;
break;
default:
FONTSIZE = 14;
break;
}
";
echo replace_double(" ",str_replace(chr(13),"",str_replace(chr(10),"","
document.writeln('
<style type=\"text/css\">
body {
font-family : Arial;
font-size: '+FONTSIZE+'px;
font-weight : normal;
color: ".$fm_color['Text'].";
background-color: ".$fm_color['Bg'].";
}
table {
font-family : Arial;
font-size: '+FONTSIZE+'px;
font-weight : normal;
color: ".$fm_color['Text'].";
cursor: default;
}
input {
font-family : Arial;
font-size: '+FONTSIZE+'px;
font-weight : normal;
color: ".$fm_color['Text'].";
}
textarea {
font-family : Courier;
font-size: 12px;
font-weight : normal;
color: ".$fm_color['Text'].";
}
a {
font-family : Arial;
font-size : '+FONTSIZE+'px;
font-weight : bold;
text-decoration: none;
color: ".$fm_color['Text'].";
}
a:link {
color: ".$fm_color['Text'].";
}
a:visited {
color: ".$fm_color['Text'].";
}
a:hover {
color: ".$fm_color['Link'].";
}
a:active {
color: ".$fm_color['Text'].";
}
tr.entryUnselected {
background-color: ".$fm_color['Entry'].";
}
tr.entryUnselected:hover {
background-color: ".$fm_color['Over'].";
}
tr.entrySelected {
background-color: ".$fm_color['Mark'].";
}
</style>
');
")));
echo "
//-->
</script>
";
}
function reloadframe($ref,$frame_number,$Plus=""){
global $current_dir,$path_info;
echo "
<script language=\"Javascript\" type=\"text/javascript\">
<!-".$ref.".frame".$frame_number.".location.href='".$path_info["basename"].
"?frame=".$frame_number."¤t_dir=".$current_dir.$Plus."';
//-->
</script>
";
}
function alert($arg){
echo "
<script language=\"Javascript\" type=\"text/javascript\">
<!-alert('$arg');
//-->
</script>
";
}
function tree($dir_before,$dir_current,$indice){
global $fm_current_root, $current_dir, $islinux;
global $expanded_dir_list;
$indice++;
$num_dir = 0;
$dir_name = str_replace($dir_before,"",$dir_current);
$dir_before = str_replace("//","/",$dir_before);
$dir_current = str_replace("//","/",$dir_current);
$is_denied = false;
if ($islinux) {
$denied_list = "/proc/dev";
$mat = explode("",$denied_list);
foreach($mat as $key => $val){
if ($dir_current == $val){
$is_denied = true;
break;
}
}
unset($mat);
}
if (!$is_denied){
if ($handle = @opendir($dir_current)){
// Permitido
while ($file = readdir($handle)){
if ($file != "." && $file != ".." && is_dir("$dir_current/$file"
))
$mat_dir[] = $file;
}
@closedir($handle);
if (count($mat_dir)){
sort($mat_dir,SORT_STRING);
// with Sub-dir
if ($indice != 0){
for ($aux=1;$aux<$indice;$aux++) echo " &nb
sp;";
p_str = "[]";
}
if ($dir_before != $dir_current){
if (strstr($expanded_dir_list,":$dir_current/$dir_name")) $o
function show_tree(){
global $fm_current_root,$path_info,$setflag,$islinux,$cookie_cache_time;
html_header("
<script language=\"Javascript\" type=\"text/javascript\">
<!-function saveFrameSize(){
if (getFrameSize()){
var exp = new Date();
exp.setTime(exp.getTime()+$cookie_cache_time);
setCookie('leftFrameWidth',frameWidth,exp);
}
}
window.onresize = saveFrameSize;
//-->
</script>");
echo "<body marginwidth=\"0\" marginheight=\"0\">\n";
echo "
<script language=\"Javascript\" type=\"text/javascript\">
<!-// Disable text selection, binding the onmousedown, but not for some ele
ments, it must work.
function disableTextSelection(e){
var type = String(e.target.type);
return (type.indexOf('select') != -1 || type.indexOf('bu
tton') != -1 || type.indexOf('input') != -1 || type.indexOf('radio') != -1);
}
function enableTextSelection(){return true}
if (is.ie) document.onselectstart=new Function('return false')
else {
document.body.onmousedown=disableTextSelection
document.body.onclick=enableTextSelection
}
var flag = ".(($setflag)?"true":"false")."
function set_flag(arg) {
flag = arg;
}
function go_dir(arg) {
var setflag;
setflag = (flag)?1:0;
document.location.href='".addslashes($path_info["basename"])."?frame
=2&setflag='+setflag+'¤t_dir=".addslashes($current_dir)."&ec_dir='+arg;
}
function go(arg) {
if (flag) {
parent.frame3.set_dir_dest(arg+'/');
flag = false;
} else {
parent.frame3.location.href='".addslashes($path_info["basename"]
)."?frame=3¤t_dir='+arg+'/';
}
}
function set_fm_current_root(arg){
document.location.href='".addslashes($path_info["basename"])."?frame
=2&set_fm_current_root='+escape(arg);
}
function atualizar(){
document.location.href='".addslashes($path_info["basename"])."?frame
=2';
}
//-->
</script>
";
echo "<table width=\"100\" height=\"100\" border=0 cellspacing=0 cellpaddi
ng=5>\n";
echo "<form><tr valign=top height=10><td>";
if (!$islinux){
echo "<select name=drive onchange=\"set_fm_current_root(this.value)\">";
$aux="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for($x=0;$x<strlen($aux);$x++){
if ($handle = opendir($aux[$x].":/")){
@closedir($handle);
if (strstr(uppercase($fm_current_root),$aux[$x].":/")) $is_s
el="selected";
else $is_sel="";
echo "<option $is_sel value=\"".$aux[$x].":/\">".$aux[$x].":
/";
}
}
echo "</select> ";
}
echo "<input type=button value=".et('Refresh')." onclick=\"atualizar()\"></t
r></form>";
echo "<tr valign=top><td>";
clearstatcache();
tree($fm_current_root,$fm_current_root,-1,0);
echo "</td></tr>";
echo "
<form name=\"login_form\" action=\"".$path_info["basename"]."\" method=\
"post\" target=\"_parent\">
<input type=hidden name=action value=1>
<tr>
<td height=10 colspan=2><input type=submit value=\"".et('Leave')."\">
</tr>
</form>
";
echo "</table>\n";
echo "</body>\n</html>";
}
function getmicrotime(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
function dir_list_form() {
global $fm_current_root,$current_dir,$quota_mb,$resolveIDs,$order_dir_list_b
y,$islinux,$cmd_name,$ip,$path_info,$fm_color;
$ti = getmicrotime();
clearstatcache();
$out = "<table border=0 cellspacing=1 cellpadding=4 width=\"100\" bgcolor=\
"eeeeee\">\n";
if ($opdir = @opendir($current_dir)) {
$has_files = false;
$entry_count = 0;
$total_size = 0;
$entry_list = array();
while ($file = readdir($opdir)) {
if (($file != ".")&&($file != "..")){
$entry_list[$entry_count]["size"] = 0;
$entry_list[$entry_count]["sizet"] = 0;
$entry_list[$entry_count]["type"] = "none";
if (is_file($current_dir.$file)){
$ext = lowercase(strrchr($file,"."));
$entry_list[$entry_count]["type"] = "file";
// Funo filetype() returns only "file"...
$entry_list[$entry_count]["size"] = filesize($current_dir.$file)
$entry_list[$entry_count]["sizet"] = format_size($entry_list[$en
try_count]["size"]);
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"] = " ";
}
$has_files = true;
} elseif (is_dir($current_dir.$file)) {
// Recursive directory size disabled
// $entry_list[$entry_count]["size"] = total_size($current_dir.$
file);
$entry_list[$entry_count]["size"] = 0;
$entry_list[$entry_count]["sizet"] = " ";
$entry_list[$entry_count]["type"] = "dir";
}
$entry_list[$entry_count]["name"] = $file;
$entry_list[$entry_count]["date"] = date("Ymd", filemtime($current_d
ir.$file));
$entry_list[$entry_count]["time"] = date("his", filemtime($current_d
ir.$file));
$entry_list[$entry_count]["datet"] = date("d/m/y h:i", filemtime($cu
rrent_dir.$file));
if ($islinux && $resolveIDs){
$entry_list[$entry_count]["p"] = show_perms(fileperms($current_d
ir.$file));
$entry_list[$entry_count]["u"] = get_user(fileowner($current_dir
.$file));
$entry_list[$entry_count]["g"] = get_group(filegroup($current_di
r.$file));
} else {
$entry_list[$entry_count]["p"] = base_convert(fileperms($current
_dir.$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($current_dir.$file);
$entry_list[$entry_count]["g"] = filegroup($current_dir.$file);
}
$total_size += $entry_list[$entry_count]["size"];
$entry_count++;
}
}
@closedir($opdir);
if($entry_count){
$or1="1A";
$or2="2D";
$or3="3A";
$or4="4A";
$or5="5A";
$or6="6D";
$or7="7D";
switch($order_dir_list_by){
}
return true;
}
// Disable text selection and bind multiple selection flag
var multipleSelection = false;
if (is.ie) {
document.onselectstart=new Function('return false');
document.onmousedown=switch_flag_on;
document.onmouseup=switch_flag_off;
// Event mouseup is not generated over scrollbar.. curiously, moused
own is.. go figure.
window.onscroll=new Function('multipleSelection=false');
window.onresize=new Function('multipleSelection=false');
} else {
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=switch_flag_on;
window.onmouseup=switch_flag_off;
}
// Using same function and a ternary operator couses bug on double click
function switch_flag_on(e) {
if (is.ie){
multipleSelection = (event.button == 1);
} else {
multipleSelection = (e.which == 1);
}
var type = String(e.target.type);
return (type.indexOf('select') != -1 || type.indexOf('bu
tton') != -1 || type.indexOf('input') != -1 || type.indexOf('radio') != -1);
}
function switch_flag_off(e) {
if (is.ie){
multipleSelection = (event.button != 1);
} else {
multipleSelection = (e.which != 1);
}
lastRows[0] = lastRows[1] = null;
update_sel_status();
return false;
}
var total_dirs_selected = 0;
var total_files_selected = 0;
function unselect(Entry){
if (!Entry.selected) return false;
Entry.selected = false;
sel_totalsize -= Entry.size;
if (Entry.type == 'dir') total_dirs_selected--;
else total_files_selected--;
return true;
}
function select(Entry){
if(Entry.selected) return false;
Entry.selected = true;
sel_totalsize += Entry.size;
if(Entry.type == 'dir') total_dirs_selected++;
else total_files_selected++;
return true;
}
function is_anything_selected(){
var selected_dir_list = new Array();
var selected_file_list = new Array();
for(var x=0;x<".(integer)count($entry_list).";x++){
if(entry_list['entry'+x].selected){
if(entry_list['entry'+x].type == 'dir') selected_dir_list.pu
sh(entry_list['entry'+x].name);
else selected_file_list.push(entry_list['entry'+x].name);
}
}
document.form_action.selected_dir_list.value = selected_dir_list.joi
n('<|*|>');
document.form_action.selected_file_list.value = selected_file_list.j
oin('<|*|>');
return (total_dirs_selected>0 || total_files_selected>0);
}
function format_size (arg) {
var resul = '';
if (arg>0){
var j = 0;
var ext = new Array(' bytes',' Kb',' Mb',' Gb',' Tb');
while (arg >= Math.pow(1024,j)) ++j;
resul = (Math.round(arg/Math.pow(1024,j-1)*100)/100) + ext[j-1];
} else resul = 0;
return resul;
}
var sel_totalsize = 0;
function update_sel_status(){
var t = total_dirs_selected+' ".et('Dir_s')." ".et('And')." '+total_
files_selected+' ".et('File_s')." ".et('Selected_s')." = '+format_size(sel_total
size);
//document.getElementById(\"sel_status\").innerHTML = t;
window.status = t;
}
// Select all/none/inverse
function selectANI(Butt){
cancel_copy_move();
for(var x=0;x<". (integer)count($entry_list).";x++){
var Row = document.getElementById('entry'+x);
var newClassName = null;
switch (Butt.value){
case '".et('SelAll')."':
if (select(entry_list[Row.id])) newClassName = 'entrySel
ected';
break;
case '".et('SelNone')."':
if (unselect(entry_list[Row.id])) newClassName = 'entryU
nselected';
break;
case '".et('SelInverse')."':
if (entry_list[Row.id].selected){
if (unselect(entry_list[Row.id])) newClassName = 'en
tryUnselected';
} else {
if (select(entry_list[Row.id])) newClassName = 'entr
ySelected';
}
break;
}
if (newClassName) {
Row.className = newClassName;
}
if (Butt.value == '".et('SelAll')."'){
for(var i=0;i<2;i++){
document.getElementById('ANI'+i).value='".et('SelNone')."';
}
} else if (Butt.value == '".et('SelNone')."'){
for(var i=0;i<2;i++){
document.getElementById('ANI'+i).value='".et('SelAll')."';
}
}
update_sel_status();
return true;
}
function download(arg){
parent.frame1.location.href='".addslashes($path_info["basename"])."?
action=3¤t_dir=".addslashes($current_dir)."&filename='+escape(arg);
}
function upload(){
var w = 400;
var h = 250;
window.open('".addslashes($path_info["basename"])."?action=10¤
t_dir=".addslashes($current_dir)."', '', 'width='+w+',height='+h+',fullscreen=no
,scrollbars=no,resizable=yes,status=no,toolbar=no,menubar=no,location=no');
}
function execute_cmd(){
var arg = prompt('".et('TypeCmd').".');
if(arg.length>0){
if(confirm('".et('ConfExec')." \\' '+arg+' \\' ?')) {
var w = 800;
var h = 600;
window.open('".addslashes($path_info["basename"])."?action=6
¤t_dir=".addslashes($current_dir)."&cmd='+escape(arg), '', 'width='+w+',he
ight='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=no,toolbar=no,menub
ar=no,location=no');
}
}
}
function decompress(arg){
if(confirm('".uppercase(et('Decompress'))." \\' '+arg+' \\' ?')) {
document.form_action.action.value = 72;
document.form_action.cmd_arg.value = arg;
document.form_action.submit();
}
}
function execute_file(arg){
if(arg.length>0){
if(confirm('".et('ConfExec')." \\' '+arg+' \\' ?')) {
var w = 800;
var h = 600;
window.open('".addslashes($path_info["basename"])."?action=1
1¤t_dir=".addslashes($current_dir)."&filename='+escape(arg), '', 'width='+
w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=no,toolbar=no
,menubar=no,location=no');
}
}
}
function edit_file(arg){
var w = 1024;
var h = 768;
// if(confirm('".uppercase(et('Edit'))." \\' '+arg+' \\' ?'))
window.open('".addslashes($path_info["basename"])."?action=7¤t
_dir=".addslashes($current_dir)."&filename='+escape(arg), '', 'width='+w+',heigh
t='+h+',fullscreen=no,scrollbars=no,resizable=yes,status=no,toolbar=no,menubar=n
o,location=no');
}
function config(){
var w = 650;
var h = 400;
window.open('".addslashes($path_info["basename"])."?action=2', 'win_
config', 'width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,st
atus=no,toolbar=no,menubar=no,location=no');
}
function server_info(arg){
var w = 800;
var h = 600;
window.open('".addslashes($path_info["basename"])."?action=5', 'win_
serverinfo', 'width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=ye
s,status=no,toolbar=no,menubar=no,location=no');
}
function shell(){
var w = 800;
var h = 600;
window.open('".addslashes($path_info["basename"])."?action=9', '', '
width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=no,to
olbar=no,menubar=no,location=no');
}
function view(arg){
var w = 800;
var h = 600;
if(confirm('".uppercase(et('View'))." \\' '+arg+' \\' ?')) window.op
en('".addslashes($path_info["basename"])."?action=4¤t_dir=".addslashes($cu
rrent_dir)."&filename='+escape(arg), '', 'width='+w+',height='+h+',fullscreen=no
,scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=yes');
}
function rename(arg){
var nome = '';
if (nome = prompt('".uppercase(et('Ren'))." \\' '+arg+' \\' ".et('To
')." ...')) document.location.href='".addslashes($path_info["basename"])."?frame
=3&action=3¤t_dir=".addslashes($current_dir)."&old_name='+escape(arg)+'&ne
w_name='+escape(nome);
}
function set_dir_dest(arg){
document.form_action.dir_dest.value=arg;
if (document.form_action.action.value.length>0) test(document.form_a
ction.action.value);
else alert('".et('JSError').".');
}
function sel_dir(arg){
document.form_action.action.value = arg;
document.form_action.dir_dest.value='';
if (!is_anything_selected()) alert('".et('NoSel').".');
else {
if (!getCookie('sel_dir_warn')) {
//alert('".et('SelDir').".');
document.cookie='sel_dir_warn'+'='+escape('true')+';';
}
set_sel_dir_warn(true);
parent.frame2.set_flag(true);
}
one');
}
function set_sel_dir_warn(b){
document.getElementById(\"sel_dir_warn\").style.display=(b?'':'n
}
function cancel_copy_move(){
set_sel_dir_warn(false);
parent.frame2.set_flag(false);
}
function chmod_form(){
cancel_copy_move();
document.form_action.dir_dest.value='';
document.form_action.chmod_arg.value='';
if (!is_anything_selected()) alert('".et('NoSel').".');
else {
var w = 280;
var h = 180;
window.open('".addslashes($path_info["basename"])."?action=8', '
', 'width='+w+',height='+h+',fullscreen=no,scrollbars=no,resizable=yes,status=no
,toolbar=no,menubar=no,location=no');
}
}
function set_chmod_arg(arg){
cancel_copy_move();
if (!is_anything_selected()) alert('".et('NoSel').".');
else {
document.form_action.dir_dest.value='';
document.form_action.chmod_arg.value=arg;
test(9);
}
}
function test_action(){
if (document.form_action.action.value != 0) return true;
else return false;
}
function test_prompt(arg){
cancel_copy_move();
var erro='';
var conf='';
if (arg == 1){
document.form_action.cmd_arg.value = prompt('".et('TypeDir').".'
);
} else if (arg == 2){
document.form_action.cmd_arg.value = prompt('".et('TypeArq').".'
);
} else if (arg == 71){
if (!is_anything_selected()) erro = '".et('NoSel').".';
else document.form_action.cmd_arg.value = prompt('".et('TypeArqC
omp')."');
}
if (erro!=''){
document.form_action.cmd_arg.focus();
alert(erro);
} else if(document.form_action.cmd_arg.value.length>0) {
document.form_action.action.value = arg;
document.form_action.submit();
}
}
function strstr(haystack,needle){
}
function valid_dest(dest,orig){
return (strstr(dest,orig)==false)?true:false;
}
// ArrayAlert - Selection debug only
function aa(){
var str = 'selected_dir_list:\\n';
for (x=0;x<selected_dir_list.length;x++){
str += selected_dir_list[x]+'\\n';
}
str += '\\nselected_file_list:\\n';
for (x=0;x<selected_file_list.length;x++){
str += selected_file_list[x]+'\\n';
}
alert(str);
}
function test(arg){
cancel_copy_move();
var erro='';
var conf='';
if (arg == 4){
if (!is_anything_selected()) erro = '".et('NoSel').".\\n';
conf = '".et('RemSel')." ?\\n';
} else if (arg == 5){
if (!is_anything_selected()) erro = '".et('NoSel').".\\n';
else if(document.form_action.dir_dest.value.length == 0) erro =
'".et('NoDestDir').".';
else if(document.form_action.dir_dest.value == document.form_act
ion.current_dir.value) erro = '".et('DestEqOrig').".';
else if(!valid_dest(document.form_action.dir_dest.value,document
.form_action.current_dir.value)) erro = '".et('InvalidDest').".';
conf = '".et('CopyTo')." \\' '+document.form_action.dir_dest.val
ue+' \\' ?\\n';
} else if (arg == 6){
if (!is_anything_selected()) erro = '".et('NoSel').".';
else if(document.form_action.dir_dest.value.length == 0) erro =
'".et('NoDestDir').".';
else if(document.form_action.dir_dest.value == document.form_act
ion.current_dir.value) erro = '".et('DestEqOrig').".';
else if(!valid_dest(document.form_action.dir_dest.value,document
.form_action.current_dir.value)) erro = '".et('InvalidDest').".';
conf = '".et('MoveTo')." \\' '+document.form_action.dir_dest.val
ue+' \\' ?\\n';
} else if (arg == 9){
if (!is_anything_selected()) erro = '".et('NoSel').".';
else if(document.form_action.chmod_arg.value.length == 0) erro =
'".et('NoNewPerm').".';
//conf = '".et('AlterPermTo')." \\' '+document.form_action.chmod
_arg.value+' \\' ?\\n';
}
if (erro!=''){
document.form_action.cmd_arg.focus();
alert(erro);
} else if(conf!='') {
if(confirm(conf)) {
document.form_action.action.value = arg;
document.form_action.submit();
} else {
set_sel_dir_warn(false);
}
} else {
document.form_action.action.value = arg;
document.form_action.submit();
}
}
//-->
</script>";
$out .= "
<form name=\"form_action\" action=\"".$path_info["basename"]."\" method=
\"post\" onsubmit=\"return test_action();\">
<input type=hidden name=\"frame\" value=3>
<input type=hidden name=\"action\" value=0>
<input type=hidden name=\"dir_dest\" value=\"\">
<input type=hidden name=\"chmod_arg\" value=\"\">
<input type=hidden name=\"cmd_arg\" value=\"\">
<input type=hidden name=\"current_dir\" value=\"$current_dir\">
<input type=hidden name=\"dir_before\" value=\"$dir_before\">
<input type=hidden name=\"selected_dir_list\" value=\"\">
<input type=hidden name=\"selected_file_list\" value=\"\">";
$out .= "
<tr>
<td bgcolor=\"DDDDDD\" colspan=50><nobr>
<input type=button onclick=\"config()\" value=\"".et('Config')."\">
<input type=button onclick=\"server_info()\" value=\"".et('ServerInf
o')."\">
<input type=button onclick=\"test_prompt(1)\" value=\"".et('CreateDi
r')."\">
<input type=button onclick=\"test_prompt(2)\" value=\"".et('CreateAr
q')."\">
<input type=button onclick=\"execute_cmd()\" value=\"".et('ExecCmd')
."\">
<input type=button onclick=\"upload()\" value=\"".et('Upload')."\">
<input type=button onclick=\"shell()\" value=\"".et('Shell')."\">
<b>$ip</b>
</nobr>";
$uplink = "";
if ($current_dir != $fm_current_root){
$mat = explode("/",$current_dir);
$dir_before = "";
for($x=0;$x<(count($mat)-2);$x++) $dir_before .= $mat[$x]."/";
$uplink = "<a href=\"".$path_info["basename"]."?frame=3¤t_dir=
$dir_before\"><<</a> ";
}
if($entry_count){
$out .= "
<tr bgcolor=\"DDDDDD\"><td colspan=50><nobr>$uplink <a href=\""
.$path_info["basename"]."?frame=3¤t_dir=$current_dir\">$current_dir</a></n
obr>
<tr>
<td bgcolor=\"DDDDDD\" colspan=50><nobr>
<input type=\"button\" style=\"width:80\" onclick=\"selectAN
I(this)\" id=\"ANI0\" value=\"".et('SelAll')."\">
<input type=\"button\" style=\"width:80\" onclick=\"selectAN
I(this)\" value=\"".et('SelInverse')."\">
<input type=\"button\" style=\"width:80\" onclick=\"test(4)\
" value=\"".et('Rem')."\">
<input type=\"button\" style=\"width:80\" onclick=\"sel_dir(
5)\" value=\"".et('Copy')."\">
$file_out[$file_count][] = "
<tr ID=\"entry$ind\" class=\"entryUnselected\" onmouseov
er=\"selectEntry(this, 'over');\" onmousedown=\"selectEntry(this, 'click');\">
<td><nobr><a href=\"JavaScript:download('".addslashes($f
ile)."')\">$file</a></nobr></td>";
$file_out[$file_count][] = "<td>".$dir_entry["p"]."</td>";
if ($islinux) {
$file_out[$file_count][] = "<td><nobr>".$dir_entry["u"].
"</nobr></td>";
$file_out[$file_count][] = "<td><nobr>".$dir_entry["g"].
"</nobr></td>";
}
$file_out[$file_count][] = "<td><nobr>".$dir_entry["sizet"].
"</nobr></td>";
$file_out[$file_count][] = "<td><nobr>".$dir_entry["datet"].
"</nobr></td>";
$file_out[$file_count][] = "<td>".$dir_entry["extt"]."</td>"
;
// Opes de arquivo
if ( is_writable($current_dir.$file) ) $file_out[$file_count
][] = "
<td align=center><a href=\"javascript:if(confirm
('".uppercase(et('Rem'))." \\'".addslashes($file)."\\' ?')) document.location.hr
ef='".addslashes($path_info["basename"])."?frame=3&action=8&cmd_arg=".addslashes
($file)."¤t_dir=".addslashes($current_dir)."'\">".et('Rem')."</a>";
else $file_out[$file_count][] = "<td> </td>";
if ( is_writable($current_dir.$file) ) $file_out[$file_count
][] = "
<td align=center><a href=\"javascript:rename('".
addslashes($file)."')\">".et('Ren')."</a>";
else $file_out[$file_count][] = "<td> </td>";
if ( is_readable($current_dir.$file) && (strpos(".wav.mp3.
mid.avi.mov.mpeg.mpg.rm.iso.bin.img.dll.psd.fla.swf.class.ppt.tif
.tiff.pcx.jpg.gif.png.wmf.eps.bmp.msi.exe.com.rar.tar.zip.bz2.tb
z2.bz.tbz.bzip.gzip.gz.tgz", $dir_entry["ext"]."" ) === false)) $file_ou
t[$file_count][] = "
<td align=center><a href=\"javascript:edit_file(
'".addslashes($file)."')\">".et('Edit')."</a>";
else $file_out[$file_count][] = "<td> </td>";
if ( is_readable($current_dir.$file) && (strpos(".txt.sys.
bat.ini.conf.swf.php.php3.asp.html.htm.jpg.gif.png.bmp", $dir_entry
["ext"]."" ) !== false)) $file_out[$file_count][] = "
<td align=center><a href=\"javascript:view('".ad
dslashes($file)."');\">".et('View')."</a>";
else $file_out[$file_count][] = "<td> </td>";
if ( is_readable($current_dir.$file) && strlen($dir_entry["e
xt"]) && (strpos(".tar.zip.bz2.tbz2.bz.tbz.bzip.gzip.gz.tgz", $dir_ent
ry["ext"]."" ) !== false)) $file_out[$file_count][] = "
<td align=center><a href=\"javascript:decompress
('".addslashes($file)."')\">".et('Decompress')."</a>";
else $file_out[$file_count][] = "<td> </td>";
if ( is_readable($current_dir.$file) && strlen($dir_entry["e
xt"]) && (strpos(".exe.com.sh.bat", $dir_entry["ext"]."" ) !== false)) $fil
e_out[$file_count][] = "
<td align=center><a href=\"javascript:execute_fi
le('".addslashes($file)."')\">".et('Exec')."</a>";
else $file_out[$file_count][] = "<td> </td>";
if (count($file_out[$file_count])>$max_opt){
$max_opt = count($file_out[$file_count]);
}
$file_count++;
}
if ($dir_count){
$out .= "
<tr>
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or1¤t_dir=$current_dir\">".et('Name')."</a></nobr>
</td>
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or2¤t_dir=$current_dir\">".et('Perm')."</a></nobr>
</td>";
if ($islinux) $out .= "
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or3¤t_dir=$current_dir\">".et('Owner')."</a></td>
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or4¤t_dir=$current_dir\">".et('Group')."</a></nobr
></td>";
$out .= "
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or5¤t_dir=$current_dir\">".et('Size')."</a></nobr>
</td>
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or6¤t_dir=$current_dir\">".et('Date')."</a></nobr>
</td>";
if ($file_count) $out .= "
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or7¤t_dir=$current_dir\">".et('Type')."</a></nobr>
</td>";
$out .= "
<td bgcolor=\"DDDDDD\" colspan=50> </td>
</tr>";
}
foreach($dir_out as $k=>$v){
while (count($dir_out[$k])<$max_opt) {
$dir_out[$k][] = "<td> </td>";
}
$out .= implode($dir_out[$k]);
$out .= "</tr>";
}
if ($file_count){
$out .= "
<tr>
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or1¤t_dir=$current_dir\">".et('Name')."</a></nobr>
</td>
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or2¤t_dir=$current_dir\">".et('Perm')."</a></nobr>
</td>";
if ($islinux) $out .= "
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or3¤t_dir=$current_dir\">".et('Owner')."</a></td>
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or4¤t_dir=$current_dir\">".et('Group')."</a></nobr
></td>";
$out .= "
<td bgcolor=\"DDDDDD\"><nobr><a href=\"".$path_info["base
name"]."?frame=3&or_by=$or5¤t_dir=$current_dir\">".et('Size')."</a></nobr>
</td>
$out .= "
<tr><td bgcolor=\"DDDDDD\" colspan=50><b>".et('RenderTime').":
".substr($tt,0,strrpos($tt,".")+5)." ".et('Seconds')."</td></tr>";
$out .= "
<script language=\"Javascript\" type=\"text/javascript\">
<!-update_sel_status();
//-->
</script>";
} else {
$out .= "
<tr>
<td bgcolor=\"DDDDDD\" width=\"1\">$uplink<td bgcolor=\"DDDDDD\"
colspan=50><nobr><a href=\"".$path_info["basename"]."?frame=3¤t_dir=$curre
nt_dir\">$current_dir</a></nobr>
<tr><td bgcolor=\"DDDDDD\" colspan=50>".et('EmptyDir').".</tr>";
}
} else $out .= "<tr><td><font color=red>".et('IOError').".<br>$current_dir</
font>";
$out .= "</table>";
echo $out;
}
function upload_form(){
global $_FILES,$current_dir,$dir_dest,$fechar,$quota_mb,$path_info;
$num_uploads = 5;
html_header();
echo "<body marginwidth=\"0\" marginheight=\"0\">";
if (count($_FILES)==0){
echo "
<table height=\"100\" border=0 cellspacing=0 cellpadding=2 align=center
>
<form name=\"upload_form\" action=\"".$path_info["basename"]."\" method=
\"post\" ENCTYPE=\"multipart/form-data\">
<input type=hidden name=dir_dest value=\"$current_dir\">
<input type=hidden name=action value=10>
<tr><th colspan=2>".et('Upload')."</th></tr>
<tr><td align=right><b>".et('Destination').":<td><b><nobr>$current_dir</
nobr>";
for ($x=0;$x<$num_uploads;$x++){
echo "<tr><td width=1 align=right><b>".et('File').":<td><nobr><input
type=\"file\" name=\"file$x\"></nobr>";
$test_js .= "(document.upload_form.file$x.value.length>0)||";
}
echo "
<input type=button value=\"".et('Send')."\" onclick=\"test_upload_form()
\"></nobr>
<tr><td> <td><input type=checkbox name=fechar value=\"1\"> <a href=\"Jav
aScript:troca();\">".et('AutoClose')."</a>
<tr><td colspan=2> </td></tr>
</form>
</table>
<script language=\"Javascript\" type=\"text/javascript\">
<!-function troca(){
if(document.upload_form.fechar.checked){document.upload_form.fec
har.checked=false;}else{document.upload_form.fechar.checked=true;}
}
foi = false;
function test_upload_form(){
if(".substr($test_js,0,strlen($test_js)-2)."){
if (foi) alert('".et('SendingForm')."...');
else {
foi = true;
document.upload_form.submit();
}
} else alert('".et('NoFileSel').".');
}
window.moveTo((window.screen.width-400)/2,((window.screen.height-200
)/2)-20);
//-->
</script>";
} else {
$out = "<tr><th colspan=2>".et('UploadEnd')."</th></tr>
<tr><th colspan=2><nobr>".et('Destination').": $dir_dest</nobr>"
;
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,$di
r_dest);
else $resul = 7;
switch($resul){
case 1:
$out .= "<tr><td><b>".str_zero($x+1,3).".<font color=green><b> "
.et('FileSent').":</font><td>".$filename."</td></tr>\n";
break;
case 2:
$out .= "<tr><td colspan=2><font color=red><b>".et('IOError')."<
/font></td></tr>\n";
$x = $upload_num;
break;
case 3:
$out .= "<tr><td colspan=2><font color=red><b>".et('SpaceLimReac
hed')." ($quota_mb Mb)</font></td></tr>\n";
$x = $upload_num;
break;
case 4:
$out .= "<tr><td><b>".str_zero($x+1,3).".<font color=red><b> ".e
t('InvExt').":</font><td>".$filename."</td></tr>\n";
break;
case 5:
$out .= "<tr><td><b>".str_zero($x+1,3).".<font color=red><b> ".e
t('FileNoOverw')."</font><td>".$filename."</td></tr>\n";
break;
case 6:
$out .= "<tr><td><b>".str_zero($x+1,3).".<font color=green><b> "
.et('FileOverw').":</font><td>".$filename."</td></tr>\n";
break;
case 7:
$out .= "<tr><td colspan=2><b>".str_zero($x+1,3).".<font color=r
ed><b> ".et('FileIgnored')."</font></td></tr>\n";
}
}
if ($fechar) {
echo "
<script language=\"Javascript\" type=\"text/javascript\">
<!-window.close();
//-->
</script>
nter>
";
} else {
echo "
<table height=\"100\" border=0 cellspacing=0 cellpadding=2 align=ce
$out
<tr><td colspan=2> </td></tr>
</table>
<script language=\"Javascript\" type=\"text/javascript\">
<!-window.focus();
//-->
</script>
";
}
}
echo "</body>\n</html>";
}
function chmod_form(){
html_header("
<script language=\"Javascript\" type=\"text/javascript\">
<!-function octalchange()
{
var val = document.chmod_form.t_total.value;
var stickybin = parseInt(val.charAt(0)).toString(2);
var ownerbin = parseInt(val.charAt(1)).toString(2);
while (ownerbin.length<3) { ownerbin=\"0\"+ownerbin; };
var groupbin = parseInt(val.charAt(2)).toString(2);
while (groupbin.length<3) { groupbin=\"0\"+groupbin; };
var otherbin = parseInt(val.charAt(3)).toString(2);
while (otherbin.length<3) { otherbin=\"0\"+otherbin; };
document.chmod_form.sticky.checked = parseInt(stickybin.charAt(0));
document.chmod_form.owner4.checked = parseInt(ownerbin.charAt(0));
document.chmod_form.owner2.checked = parseInt(ownerbin.charAt(1));
document.chmod_form.owner1.checked = parseInt(ownerbin.charAt(2));
document.chmod_form.group4.checked = parseInt(groupbin.charAt(0));
document.chmod_form.group2.checked = parseInt(groupbin.charAt(1));
document.chmod_form.group1.checked = parseInt(groupbin.charAt(2));
document.chmod_form.other4.checked = parseInt(otherbin.charAt(0));
document.chmod_form.other2.checked = parseInt(otherbin.charAt(1));
document.chmod_form.other1.checked = parseInt(otherbin.charAt(2));
calc_chmod(1);
};
function calc_chmod(nototals)
{
var users = new Array(\"owner\", \"group\", \"other\");
var totals = new Array(\"\",\"\",\"\");
var syms = new Array(\"\",\"\",\"\");
for (var i=0; i<users.length; i++)
{
var user=users[i];
var field4 = user + \"4\";
var field2 = user + \"2\";
var field1 = user + \"1\";
var symbolic = \"sym_\" + user;
var number = 0;
var sym_string = \"\";
window.onload=octalchange
window.moveTo((window.screen.width-400)/2,((window.screen.height-200)/2)-20)
//-->
</script>");
echo "<body marginwidth=\"0\" marginheight=\"0\">
<form name=\"chmod_form\">
<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"4\" ALIGN=CENTER>
<tr><th colspan=4>".et('Perms')."</th></tr>
<TR ALIGN=\"LEFT\" VALIGN=\"MIDDLE\">
<TD><input type=\"text\" name=\"t_total\" value=\"0755\" size=\"4\" onKeyUp=
\"octalchange()\"> </TD>
<TD><input type=\"text\" name=\"sym_total\" value=\"\" size=\"12\" READONLY=
\"1\"></TD>
</TR>
</TABLE>
<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" ALIGN=CENTER>
<tr bgcolor=\"333333\">
<td WIDTH=\"60\" align=\"left\"> </td>
<td WIDTH=\"55\" align=\"center\" style=\"color:FFFFFF\"><b>".et('Owner')."
</b></td>
<td WIDTH=\"55\" align=\"center\" style=\"color:FFFFFF\"><b>".et('Group')."
</b></td>
<td WIDTH=\"55\" align=\"center\" style=\"color:FFFFFF\"><b>".et('Other')."
<b></td>
</tr>
<tr bgcolor=\"DDDDDD\">
<td WIDTH=\"60\" align=\"left\" nowrap BGCOLOR=\"FFFFFF\">".et('Read')."</t
d>
<td WIDTH=\"55\" align=\"center\" bgcolor=\"EEEEEE\">
<input type=\"checkbox\" name=\"owner4\" value=\"4\" onclick=\"calc_chmod()\
">
</td>
<td WIDTH=\"55\" align=\"center\" bgcolor=\"FFFFFF\"><input type=\"checkbox
\" name=\"group4\" value=\"4\" onclick=\"calc_chmod()\">
</td>
<td WIDTH=\"55\" align=\"center\" bgcolor=\"EEEEEE\">
<input type=\"checkbox\" name=\"other4\" value=\"4\" onclick=\"calc_chmod()\
">
</td>
</tr>
<tr bgcolor=\"DDDDDD\">
<td WIDTH=\"60\" align=\"left\" nowrap BGCOLOR=\"FFFFFF\">".et('Write')."</
td>
<td WIDTH=\"55\" align=\"center\" bgcolor=\"EEEEEE\">
<input type=\"checkbox\" name=\"owner2\" value=\"2\" onclick=\"calc_chmod()\
"></td>
<td WIDTH=\"55\" align=\"center\" bgcolor=\"FFFFFF\"><input type=\"checkbox
\" name=\"group2\" value=\"2\" onclick=\"calc_chmod()\">
</td>
<td WIDTH=\"55\" align=\"center\" bgcolor=\"EEEEEE\">
<input type=\"checkbox\" name=\"other2\" value=\"2\" onclick=\"calc_chmod()\
">
</td>
</tr>
<tr bgcolor=\"DDDDDD\">
<td WIDTH=\"60\" align=\"left\" nowrap BGCOLOR=\"FFFFFF\">".et('Exec')."</t
d>
<td WIDTH=\"55\" align=\"center\" bgcolor=\"EEEEEE\">
<input type=\"checkbox\" name=\"owner1\" value=\"1\" onclick=\"calc_chmod()\
">
</td>
<td WIDTH=\"55\" align=\"center\" bgcolor=\"FFFFFF\"><input type=\"checkbox
\" name=\"group1\" value=\"1\" onclick=\"calc_chmod()\">
</td>
<td WIDTH=\"55\" align=\"center\" bgcolor=\"EEEEEE\">
<input type=\"checkbox\" name=\"other1\" value=\"1\" onclick=\"calc_chmod()\
">
</td>
</tr>
</TABLE>
<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"4\" ALIGN=CENTER>
<tr><td colspan=2><input type=checkbox name=sticky value=\"1\" onclick=\"cal
'aifc'
'ram'
'rm'
'rpm'
'ra'
'rv'
'wav'
'bmp'
'gif'
'jpeg'
'jpg'
'jpe'
'png'
'tiff'
'tif'
'css'
'html'
'htm'
'shtml'
'txt'
'text'
'log'
'rtx'
'rtf'
'xml'
'xsl'
'mpeg'
'mpg'
'mpe'
'qt'
'mov'
'avi'
'movie'
'doc'
'docx'
'word'
'xl'
'xls'
'xlsx'
'eml'
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
'audio/x-aiff',
'audio/x-pn-realaudio',
'audio/x-pn-realaudio',
'audio/x-pn-realaudio-plugin',
'audio/x-realaudio',
'video/vnd.rn-realvideo',
'audio/x-wav',
'image/bmp',
'image/gif',
'image/jpeg',
'image/jpeg',
'image/jpeg',
'image/png',
'image/tiff',
'image/tiff',
'text/css',
'text/html',
'text/html',
'text/html',
'text/plain',
'text/plain',
'text/plain',
'text/richtext',
'text/rtf',
'text/xml',
'text/xml',
'video/mpeg',
'video/mpeg',
'video/mpeg',
'video/quicktime',
'video/quicktime',
'video/x-msvideo',
'video/x-sgi-movie',
'application/msword',
'application/msword',
'application/msword',
'application/excel',
'application/excel',
'application/excel',
'message/rfc822'
);
return (!isset($mimes[lowercase($ext)])) ? 'application/octet-stream' : $mim
es[lowercase($ext)];
}
function view(){
global $doc_root,$path_info,$url_info,$current_dir,$islinux,$filename,$passt
hru;
if (intval($passthru)){
$file = $current_dir.$filename;
if(file_exists($file)){
$is_denied = false;
foreach($download_ext_filter as $key=>$ext){
if (eregi($ext,$filename)){
$is_denied = true;
break;
}
}
if (!$is_denied){
if ($fh = fopen("$file", "rb")){
fclose($fh);
N);
) $ctype = "text/plain";
post-check=0, pre-check=0");
er");
header("Content-Type: ".$ctype);
header("Content-Disposition: inline; filenam
e=\"".pathinfo($file, PATHINFO_BASENAME)."\";");
header("Content-Transfer-Encoding: binar
y");
header("Content-Length: ".filesize($file
));
@readfile($file);
exit();
} else alert(et('ReadDenied').": ".$file);
} else alert(et('ReadDenied').": ".$file);
} else alert(et('FileNotFound').": ".$file);
echo "
<script language=\"Javascript\" type=\"text/javascript\">
<!-window.close();
//-->
</script>";
} else {
html_header();
echo "<body marginwidth=\"0\" marginheight=\"0\">";
$is_reachable_thru_webserver = (stristr($current_dir,$doc_root)!==fa
lse);
if ($is_reachable_thru_webserver){
$url = $url_info["scheme"]."://".$url_info["host"];
if (strlen($url_info["port"])) $url .= ":".$url_info["port"];
// Malditas variaveis de sistema!! No windows doc_root sempre em
lowercase... cad o str_ireplace() ??
$url .= str_replace($doc_root,"","/".$current_dir).$filename;
} else {
$url = addslashes($path_info["basename"])."?action=4&cur
rent_dir=".addslashes($current_dir)."&filename=".addslashes($filename)."&passthr
u=1";
}
echo "
<script language=\"Javascript\" type=\"text/javascript\">
<!-window.moveTo((window.screen.width-800)/2,((window.screen.height
-600)/2)-20);
document.location.href='$url';
//-->
</script>
</body>\n</html>";
}
}
function edit_file_form(){
global $current_dir,$filename,$file_data,$save_file,$path_info;
\">
$file = $current_dir.$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 "<body marginwidth=\"0\" marginheight=\"0\">
<table border=0 cellspacing=0 cellpadding=5 align=center>
<form name=\"edit_form\" action=\"".$path_info["basename"]."\" method=\"post
echo "
<table border=0 cellspacing=0 cellpadding=5 align=center width=\"100\">
<tr><td colspan=2 align=center><b>".uppercase(et('Configurations'))."</b></t
d></tr>
</table>
<table border=0 cellspacing=0 cellpadding=5 align=center width=\"100\">
<form>
<tr><td align=right width=\"1\">".et('Version').":<td>$version (".get_size(
$fm_self).")</td></tr>
<tr><td align=right>".et('Website').":<td><a href=\"JavaScript:open_win('htt
p://phpfm.sf.net')\">http://phpfm.sf.net</a> <input type=button
value=\"".et('ChkVer')."\" onclick=\"test_config_form(1)\"></td></tr>
</form>";
if (strlen($ChkVerWarning)) echo $ChkVerWarning.$data['warnings'];
echo "
<style type=\"text/css\">
.buymeabeer {
background: url('http://phpfm.sf.net/img/buymeabeer.png') 0
0 no-repeat;
text-indent: -9999px;
width: 128px;
height: 31px;
border: none;
cursor: hand;
cursor: pointer;
}
.buymeabeer:hover {
background: url('http://phpfm.sf.net/img/buymeabeer.png') 0
-31px no-repeat;
}
</style>
<tr><td align=right>Like this project?</td><td>
<form name=\"buymeabeer_form\" action=\"https://www.paypal.com/cgi-bin/w
ebscr\" method=\"post\">
<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">
<input type=\"hidden\" name=\"business\" value=\"dulldusk@gmail.
com\">
<input type=\"hidden\" name=\"lc\" value=\"BR\">
<input type=\"hidden\" name=\"item_name\" value=\"A Beer\">
<input type=\"hidden\" name=\"button_subtype\" value=\"services\
">
<input type=\"hidden\" name=\"currency_code\" value=\"USD\">
<input type=\"hidden\" name=\"tax_rate\" value=\"0.000\">
<input type=\"hidden\" name=\"shipping\" value=\"0.00\">
<input type=\"hidden\" name=\"bn\" value=\"PP-BuyNowBF:btn_buyno
wCC_LG.gif:NonHostedGuest\">
<input type=\"submit\" class=\"buymeabeer\" value=\"buy me a beer\">
<input type=\"hidden\" name=\"buyer_credit_promo_code\" value=\"
\">
<input type=\"hidden\" name=\"buyer_credit_product_category\" va
lue=\"\">
<input type=\"hidden\" name=\"buyer_credit_shipping_method\" val
ue=\"\">
<input type=\"hidden\" name=\"buyer_credit_user_address_change\"
value=\"\">
<input type=\"hidden\" name=\"tax\" value=\"0\">
<input type=\"hidden\" name=\"no_shipping\" value=\"1\">
<input type=\"hidden\" name=\"return\" value=\"http://phpfm.sf.n
et\">
<input type=\"hidden\" name=\"cancel_return\" value=\"http://php
fm.sf.net\">
</form>
</td></tr>
<form name=\"config_form\" action=\"".$path_info["basename"]."\" method=\"po
st\">
<input type=hidden name=action value=2>
<input type=hidden name=config_action value=0>
<tr><td align=right width=1><nobr>".et('DocRoot').":</nobr><td>".$doc_root."
</td></tr>
<tr><td align=right><nobr>".et('FLRoot').":</nobr><td><input type=text size=
60 name=newfm_root value=\"".$cfg->data['fm_root']."\" onkeypress=\"enterSubmit(
event,'test_config_form(2)')\"></td></tr>
<tr><td align=right>".et('Lang').":<td>
<select name=newlang>
<option value=cat>Catalan - by Pere Borrs AKA @Norl
<option value=nl>Dutch - by Leon Buijs
<option value=en>English - by Fabricio Seger Kolling
<option value=fr1>French - by Jean Bilwes
<option value=fr2>French - by Sharky
<option value=fr3>French - by Michel Lainey
<option value=de1>German - by Guido Ogrzal
<option value=de2>German - by AXL
<option value=de3>German - by Mathias Rothe
<option value=it1>Italian - by Valerio Capello
<option value=it2>Italian - by Federico Corr
<option value=it3>Italian - by Luca Zorzi
<option value=it4>Italian - by Gianni
<option value=kr>Korean - by Airplanez
<option value=pt>Portuguese - by Fabricio Seger Kolling
<option value=es>Spanish - by Sh Studios
<option value=ru>Russian - by
<option value=tr>Turkish - by Necdet Yazilimlari
</select></td></tr>
<tr><td align=right>".et('ErrorReport').":<td><select name=newerror>
<option value=\"0\">Disabled
<option value=\"1\">Show Errors
<option value=\"2\">Show Errors, Warnings and Notices
</select></td></tr>
<tr><td> <td><input type=button value=\"".et('SaveConfig')."\" onclick=\"tes
t_config_form(2)\">";
if (strlen($Warning1)) echo " <font color=red>$Warning1</font>";
echo "
<tr><td align=right>".et('Pass').":<td><input type=text size=30 name=newpass
value=\"\" onkeypress=\"enterSubmit(event,'test_config_form(3)')\"></td></tr>
<tr><td> <td><input type=button value=\"".et('SavePass')."\" onclick=\"test_
config_form(3)\">";
if (strlen($Warning2)) echo " <font color=red>$Warning2</font>";
echo "</td></tr>";
echo "
</form>
</table>
<script language=\"Javascript\" type=\"text/javascript\">
<!-function set_select(sel,val){
for(var x=0;x<sel.length;x++){
if(sel.options[x].value==val){
sel.options[x].selected=true;
break;
}
}
]."');
}
set_select(document.config_form.newlang,'".$cfg->data['lang']."');
set_select(document.config_form.newerror,'".$cfg->data['error_reporting'
function test_config_form(arg){
document.config_form.config_action.value = arg;
document.config_form.submit();
}
function open_win(url){
var w = 800;
var h = 600;
window.open(url, '', 'width='+w+',height='+h+',fullscreen=no,scrollb
ars=yes,resizable=yes,status=yes,toolbar=yes,menubar=yes,location=yes');
}
window.moveTo((window.screen.width-600)/2,((window.screen.height-400)/2)
-20);
window.focus();
//-->
</script>
";
echo "</body>\n</html>";
}
function shell_form(){
global $current_dir,$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 "
<body marginwidth=\"0\" marginheight=\"0\">
<table border=0 cellspacing=0 cellpadding=0 align=center>
<form name=\"data_form\">
<tr><td><textarea name=data_out rows=36 cols=105 READONLY=\"1\"></te
xtarea></td></tr>
</form>
</table>
</body></html>";
break;
case 2:
html_header();
echo "
<body marginwidth=\"0\" marginheight=\"0\">
<table border=0 cellspacing=0 cellpadding=0 align=center>
<form name=\"shell_form\" action=\"".$path_info["basename"]."\" meth
od=\"post\">
<input type=hidden name=current_dir value=\"$current_dir\">
<input type=hidden name=action value=\"9\">
<input type=hidden name=shell_form value=\"2\">
<tr><td align=center><input type=text size=90 name=cmd_arg></td></tr
>
</form>";
echo "
<script language=\"Javascript\" type=\"text/javascript\">
<!--";
if (strlen($data_out)) echo "
var val = ' ".html_encode($cmd_arg)."\\n".html_encode(str_repla
ce("<","[",str_replace(">","]",str_replace("\n","\\n",str_replace("'","\'",str_r
eplace("\\","\\\\",$data_out))))))."\\n';
parent.frame1.document.data_form.data_out.value += val;
parent.frame1.document.data_form.data_out.scroll
Top = parent.frame1.document.data_form.data_out.scrollHeight;";
echo "
document.shell_form.cmd_arg.focus();
//-->
</script>
";
echo "
</table>
</body></html>";
break;
default:
html_header("
<script language=\"Javascript\" type=\"text/javascript\">
<!-window.moveTo((window.screen.width-800)/2,((window.screen.height
-600)/2)-20);
//-->
</script>");
echo "
<frameset rows=\"570,*\" framespacing=\"0\" frameborder=no>
<frame src=\"".$path_info["basename"]."?action=9&shell_form=1\"
name=frame1 border=\"0\" marginwidth=\"0\" marginheight=\"0\">
<frame src=\"".$path_info["basename"]."?action=9&shell_form=2\"
name=frame2 border=\"0\" marginwidth=\"0\" marginheight=\"0\">
</frameset>
</html>";
}
}
function server_info(){
if (!@phpinfo()) echo et('NoPhpinfo')."...";
echo "<br><br>";
$a=ini_get_all();
$output="<table border=1 cellspacing=0 cellpadding=4 align=center>";
$output.="<tr><th colspan=2>ini_get_all()</td></tr>";
while(list($key, $value)=each($a)) {
list($k, $v)= each($a[$key]);
$output.="<tr><td align=right>$key</td><td>$v</td></tr>";
}
$output.="</table>";
echo $output;
echo "<br><br>";
$output="<table border=1 cellspacing=0 cellpadding=4 align=center>";
$output.="<tr><th colspan=2>\$_SERVER</td></tr>";
foreach ($_SERVER as $k=>$v) {
$output.="<tr><td align=right>$k</td><td>$v</td></tr>";
}
$output.="</table>";
echo $output;
echo "<br><br>";
echo "<table border=1 cellspacing=0 cellpadding=4 align=center>";
$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 = (uppercase(substr(PHP_OS, 0, 3)) === 'WIN');
echo "<tr><td colspan=2>".php_uname();
echo "<tr><td>safe_mode<td>".($safe_mode?"on":"off");
global $pass,$auth_pass,$path_info;
if (md5(trim($pass)) == $auth_pass){
setcookie("loggedon",$auth_pass,0,"/");
header ("Location: ".$path_info["basename"]."");
} else header ("Location: ".$path_info["basename"]."?erro=1");
}
function login_form(){
global $erro,$auth_pass,$path_info;
html_header();
echo "<body onLoad=\"if(parent.location.href != self.location.href){ parent.
location.href = self.location.href } return true;\">\n";
if ($auth_pass != md5("")){
echo "
<table border=0 cellspacing=0 cellpadding=5>
<form name=\"login_form\" action=\"".$path_info["basename"]."\" meth
od=\"post\">
<tr>
<td><b>".et('FileMan')."</b>
</tr>
<tr>
<td align=left><font size=4>".et('TypePass').".</font>
</tr>
<tr>
<td><input name=pass type=password size=10> <input type=submit value
=\"".et('Send')."\">
</tr>
";
if (strlen($erro)) echo "
<tr>
<td align=left><font color=red size=4>".et('InvPass').".</font>
</tr>
";
echo "
</form>
</table>
<script language=\"Javascript\" type=\"text/javascript\">
<!-document.login_form.pass.focus();
//-->
</script>
";
} else {
echo "
<table border=0 cellspacing=0 cellpadding=5>
<form name=\"login_form\" action=\"".$path_info["basename"]."\" meth
od=\"post\">
<input type=hidden name=frame value=3>
<input type=hidden name=pass value=\"\">
<tr>
<td><b>".et('FileMan')."</b>
</tr>
<tr>
<td><input type=submit value=\"".et('Enter')."\">
</tr>
</form>
</table>
";
}
echo "</body>\n</html>";
}
function frame3(){
global $islinux,$cmd_arg,$chmod_arg,$zip_dir,$fm_current_root,$cookie_cache_
time;
global $dir_dest,$current_dir,$dir_before;
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 , time()+$cookie_cache
_time , "/");
} elseif (strlen($or_by)){
$order_dir_list_by = $or_by;
setcookie("order_dir_list_by", $or_by , time()+$cookie_cache_time , "/")
;
}
html_header();
echo "<body>\n";
if ($action){
switch ($action){
case 1: // create dir
if (strlen($cmd_arg)){
$cmd_arg = format_path($current_dir.$cmd_arg);
if (!file_exists($cmd_arg)){
@mkdir($cmd_arg,0755);
@chmod($cmd_arg,0755);
reloadframe("parent",2,"&ec_dir=".$cmd_arg);
} else alert(et('FileDirExists').".");
}
break;
case 2: // create arq
if (strlen($cmd_arg)){
$cmd_arg = $current_dir.$cmd_arg;
if (!file_exists($cmd_arg)){
if ($fh = @fopen($cmd_arg, "w")){
@fclose($fh);
}
@chmod($cmd_arg,0644);
} else alert(et('FileDirExists').".");
}
break;
case 3: // rename arq ou dir
if ((strlen($old_name))&&(strlen($new_name))){
rename($current_dir.$old_name,$current_dir.$new_name);
if (is_dir($current_dir.$new_name)) reloadframe("parent",2);
}
break;
case 4: // delete sel
if(strstr($current_dir,$fm_current_root)){
if (strlen($selected_file_list)){
$selected_file_list = explode("<|*|>",$selected_file_list);
if (count($selected_file_list)) {
for($x=0;$x<count($selected_file_list);$x++) {
$selected_file_list[$x] = trim($selected_file_list[$
x]);
if (strlen($selected_file_list[$x])) total_delete($c
urrent_dir.$selected_file_list[$x],$dir_dest.$selected_file_list[$x]);
}
}
}
if (strlen($selected_dir_list)){
);
$selected_dir_list = explode("<|*|>",$selected_dir_list);
if (count($selected_dir_list)) {
for($x=0;$x<count($selected_dir_list);$x++) {
$selected_dir_list[$x] = trim($selected_dir_list[$x]
if (strlen($selected_dir_list[$x])) total_delete($cu
rrent_dir.$selected_dir_list[$x],$dir_dest.$selected_dir_list[$x]);
}
reloadframe("parent",2);
}
}
}
break;
case 5: // copy sel
if (strlen($dir_dest)){
if(uppercase($dir_dest) != uppercase($current_dir)){
if (strlen($selected_file_list)){
$selected_file_list = explode("<|*|>",$selected_file_lis
t);
if (count($selected_file_list)) {
for($x=0;$x<count($selected_file_list);$x++) {
$selected_file_list[$x] = trim($selected_file_li
st[$x]);
if (strlen($selected_file_list[$x])) total_copy(
$current_dir.$selected_file_list[$x],$dir_dest.$selected_file_list[$x]);
}
}
}
if (strlen($selected_dir_list)){
$selected_dir_list = explode("<|*|>",$selected_dir_list)
;
if (count($selected_dir_list)) {
for($x=0;$x<count($selected_dir_list);$x++) {
$selected_dir_list[$x] = trim($selected_dir_list
[$x]);
if (strlen($selected_dir_list[$x])) total_copy($
current_dir.$selected_dir_list[$x],$dir_dest.$selected_dir_list[$x]);
}
reloadframe("parent",2);
}
}
$current_dir = $dir_dest;
}
}
break;
case 6: // move sel
if (strlen($dir_dest)){
if(uppercase($dir_dest) != uppercase($current_dir)){
if (strlen($selected_file_list)){
$selected_file_list = explode("<|*|>",$selected_file_lis
t);
if (count($selected_file_list)) {
for($x=0;$x<count($selected_file_list);$x++) {
$selected_file_list[$x] = trim($selected_file_li
st[$x]);
if (strlen($selected_file_list[$x])) total_move(
$current_dir.$selected_file_list[$x],$dir_dest.$selected_file_list[$x]);
}
}
}
[$x]);
if (strlen($selected_dir_list)){
$selected_dir_list = explode("<|*|>",$selected_dir_list)
if (count($selected_dir_list)) {
for($x=0;$x<count($selected_dir_list);$x++) {
$selected_dir_list[$x] = trim($selected_dir_list
if (strlen($selected_dir_list[$x])) total_move($
current_dir.$selected_dir_list[$x],$dir_dest.$selected_dir_list[$x]);
}
reloadframe("parent",2);
}
}
$current_dir = $dir_dest;
}
}
break;
case 71: // compress sel
if (strlen($cmd_arg)){
ignore_user_abort(true);
ini_set("display_errors",0);
ini_set("max_execution_time",0);
$zipfile=false;
if (strstr($cmd_arg,".tar")) $zipfile = new tar_file($cmd_arg);
elseif (strstr($cmd_arg,".zip")) $zipfile = new zip_file($cmd_ar
g);
elseif (strstr($cmd_arg,".bzip")) $zipfile = new bzip_file($cmd_
arg);
elseif (strstr($cmd_arg,".gzip")) $zipfile = new gzip_file($cmd_
arg);
if ($zipfile){
$zipfile->set_options(array('basedir'=>$current_dir,'overwri
te'=>1,'level'=>3));
if (strlen($selected_file_list)){
$selected_file_list = explode("<|*|>",$selected_file_lis
t);
if (count($selected_file_list)) {
for($x=0;$x<count($selected_file_list);$x++) {
$selected_file_list[$x] = trim($selected_file_li
st[$x]);
if (strlen($selected_file_list[$x])) $zipfile->a
dd_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;$x<count($selected_dir_list);$x++) {
$selected_dir_list[$x] = trim($selected_dir_list
[$x]);
if (strlen($selected_dir_list[$x])) $zipfile->ad
d_files($selected_dir_list[$x]);
}
}
}
$zipfile->create_archive();
}
unset($zipfile);
}
break;
case 72: // decompress arq
if (strlen($cmd_arg)){
if (file_exists($current_dir.$cmd_arg)){
$zipfile=false;
if (strstr($cmd_arg,".zip")) zip_extract();
elseif (strstr($cmd_arg,".bzip")||strstr($cmd_arg,".bz2")||s
trstr($cmd_arg,".tbz2")||strstr($cmd_arg,".bz")||strstr($cmd_arg,".tbz")) $zipfi
le = new bzip_file($cmd_arg);
elseif (strstr($cmd_arg,".gzip")||strstr($cmd_arg,".gz")||st
rstr($cmd_arg,".tgz")) $zipfile = new gzip_file($cmd_arg);
elseif (strstr($cmd_arg,".tar")) $zipfile = new tar_file($cm
d_arg);
if ($zipfile){
$zipfile->set_options(array('basedir'=>$current_dir,'ove
rwrite'=>1));
$zipfile->extract_files();
}
unset($zipfile);
reloadframe("parent",2);
}
}
break;
case 8: // delete arq/dir
if (strlen($cmd_arg)){
if (file_exists($current_dir.$cmd_arg)) total_delete($current_di
r.$cmd_arg);
if (is_dir($current_dir.$cmd_arg)) reloadframe("parent",2);
}
break;
case 9: // CHMOD
if((strlen($chmod_arg) == 4)&&(strlen($current_dir))){
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);
if (strlen($selected_file_list)){
$selected_file_list = explode("<|*|>",$selected_file_list);
if (count($selected_file_list)) {
for($x=0;$x<count($selected_file_list);$x++) {
$selected_file_list[$x] = trim($selected_file_list[$
x]);
if (strlen($selected_file_list[$x])) @chmod($current
_dir.$selected_file_list[$x],$new_mod);
}
}
}
if (strlen($selected_dir_list)){
$selected_dir_list = explode("<|*|>",$selected_dir_list);
if (count($selected_dir_list)) {
for($x=0;$x<count($selected_dir_list);$x++) {
$selected_dir_list[$x] = trim($selected_dir_list[$x]
);
if (strlen($selected_dir_list[$x])) @chmod($current_
dir.$selected_dir_list[$x],$new_mod);
}
}
}
}
break;
}
if ($action != 10) dir_list_form();
} else dir_list_form();
echo "</body>\n</html>";
}
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_rep
lace(":".$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,$leftFrameWidth;
if (!isset($leftFrameWidth)) $leftFrameWidth = 300;
html_header();
echo "
<frameset cols=\"".$leftFrameWidth.",*\" framespacing=\"0\">
<frameset rows=\"0,*\" framespacing=\"0\" frameborder=\"0\">
<frame src=\"".$path_info["basename"]."?frame=1\" name=frame1 border
=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\">
<frame src=\"".$path_info["basename"]."?frame=2\" name=frame2 border
=\"0\" marginwidth=\"0\" marginheight=\"0\">
</frameset>
<frame src=\"".$path_info["basename"]."?frame=3\" name=frame3 border=\"0
\" marginwidth=\"0\" marginheight=\"0\">
</frameset>
</html>";
}
// +-------------------------------------------------// | 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 th
at have
| been compressed by either bzip2 or gzip. For greater support, use the functi
ons
| 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['bas
edir']);
$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['na
me']);
}
if(!empty($this->options['prepend']))
{
$this->options['prepend'] = str_replace("\\","/",$this->options['pre
pend']);
$this->options['prepend'] = preg_replace("/(\.*\/+)+/","",$this->op
tions['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['n
ame'] . ($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->opt
ions['type'] == "gzip" || $this->options['type'] == "bzip"? ".tmp" : ""),"wb+"))
{
chdir($Pwd);
}
else
{
$this->error[] = "Could not open {$this->options['name']} for wr
iting.";
chdir($Pwd);
return 0;
}
}
else
{
$this->archive = "";
}
switch($this->options['type'])
{
case "zip":
if(!$this->create_zip())
{
$this->error[] = "Could
return 0;
}
break;
case "bzip":
if(!$this->create_tar())
{
$this->error[] = "Could
return 0;
}
if(!$this->create_bzip())
{
$this->error[] = "Could
return 0;
}
break;
case "gzip":
if(!$this->create_tar())
{
$this->error[] = "Could
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'],0644);
if($this->options['type'] == "gzip" || $this->options['type'] == "bz
ip")
. ".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,"*"))
{
\\1",$current);
"/")) : ".";
nd'] .
$regex = preg_replace("/([\\\\$\.\[\]\|\(\)\?\+\{\}\/])/","\\\\
$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['prepe
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("/(\.+\/*)+$/",$dir
name))
{
$files = array(array('name'=>$dirname,'name2'=>$this->options['prepe
nd'] .
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->opti
ons['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($dirnam
e."/".$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 memo
ry. 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['na
me'],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-chec
k=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']} t
o archive because the filename is too long.";
continue;
}
}
$block = pack("a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12",$curre
nt['name2'],decoct($current['stat'][2]),
sprintf("6s ",decoct($current['stat'][4])),sprintf("6s ",decoc
t($current['stat'][5])),
sprintf("11s ",decoct($current['stat'][7])),sprintf("11s ",dec
oct($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 rea
ding. 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/a8c
hecksum/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 th
is 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['na
me']}, 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'],0755);
//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($fil
e['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 : (51
2 - $file['stat'][7] 512));
fclose($new);
@chmod($file['name'],0644);
//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 wri
ting.";
}
}
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
{
iting.";
}
chdir($Pwd);
return 0;
}
else
{
}
}
$this->archive = gzencode($this->archive,$this->options['level']);
return 1;
function open_archive()
{
return @gzopen($this->options['name'],"rb");
}
iting.";
$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 wr
chdir($Pwd);
return 0;
}
else
{
}
}
$this->archive = bzcompress($this->archive,$this->options['level']);
return 1;
function open_archive()
{
return @bzopen($this->options['name'],"rb");
}
{
['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",13
0),''=>pack("C",131),''=>pack("C",132),
''=>pack("C",133),''=>pack("C",134),''=>pack("C",13
5),''=>pack("C",136),''=>pack("C",137),
''=>pack("C",138),''=>pack("C",139),''=>pack("C",14
0),''=>pack("C",141),''=>pack("C",142),
''=>pack("C",143),''=>pack("C",144),''=>pack("C",14
5),''=>pack("C",146),''=>pack("C",147),
''=>pack("C",148),''=>pack("C",149),''=>pack("C",15
0),''=>pack("C",151),'_'=>pack("C",152),
''=>pack("C",153),''=>pack("C",154),''=>pack("C",15
6),''=>pack("C",157),'_'=>pack("C",158),
''=>pack("C",159),''=>pack("C",160),''=>pack("C",16
1),''=>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) | ($t
imedate[2] << 16) |
($timedate[3] << 11) | ($timedate[4] << 5) | ($timedate[5]);
$block = pack("VvvvV",0x04034b50,0x000A,0x0000,(isset($current['meth
od']) || $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->opt
ions['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,$o
ffset);
$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->opt
ions['method'] == 0? 0x0000 : 0x000A,0x0000,
(isset($current['method']) || $this->options['method'] == 0)
? 0x0000 : 0x0008,$timedate,
0x00000000,0x00000000,0x00000000,strlen($current['name2']),0
x0000,0x0000,0x0000,0x0000,$current['type'] == 5? 0x00000010 : 0x00000000,$offse
t);
$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->opt
ions['method'] == 0? 0x0000 : 0x000A,0x0000,
(isset($current['method']) || $this->options['method'] == 0)
? 0x0000 : 0x0008,$timedate,
$crc32,$size,$current['stat'][7],strlen($current['name2']),0
x0000,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 rea
ding. It was not added.";
}
}
$this->add_data($central);
$this->add_data(pack("VvvvvVVv",0x06054b50,0x0000,0x0000,$files,$files,s
trlen($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
// +-------------------------------------------------?>