addExclusion($fm_cf_exclusion); /* header('Content-Type: text/plain'); var_dump($dcFM); //var_dump($dcFM->getDir()); exit; //*/ # Téléchargement d'un fichier if (!empty($_GET['dl']) && $dcFM->isFile() && !$dcFM->isExclude()) { if (strpos(basename($dcFM->base_path),'.') === false) { $mime_type = 'text/plain'; } elseif (preg_match('/.png$/',$dcFM->base_path)) { $mime_type = 'image/png'; } elseif (preg_match('/.gif$/',$dcFM->base_path)) { $mime_type = 'image/gif'; } elseif (preg_match('/.(jpg|jpeg)$/',$dcFM->base_path)) { $mime_type = 'image/jpeg'; } elseif (preg_match('/('.$dcFM->_types['txt'].')$/',$dcFM->base_path)) { $mime_type = 'text/plain'; } else { $mime_type = 'application/download'; } header('Content-Type: '.$mime_type); if ($mime_type == 'application/download') { header('Content-Disposition: attachment; filename='.basename($dcFM->base_path)); } echo $dcFM->getContent(); exit; } # Création d'un répertoire if (!empty($_GET['new_dir']) && $dcFM->isWritable() && !$dcFM->isExclude()) { if ($dcFM->newDir($_GET['new_dir']) !== false) { header('Location: '.$p_url.'&f='.$dcFM->base_path); exit; } else { $err = '
'.__('Cannot create this directory.').'
'; } } # Ajout d'un fichier if (!empty($_FILES['up_file']) && !$dcFM->isExclude()) { $up_name = trim(str_replace('/','',$_POST['up_name'])); $tmp_file = $_FILES['up_file']['tmp_name']; $file_name = $_FILES['up_file']['name']; $dest_file = $dcFM->root.$dcFM->base_path.'/'.$file_name; if ($up_name != '') { $dest_file = $dcFM->root.$dcFM->base_path.'/'.$up_name; } $uerr = array(); if (version_compare(phpversion(),'4.2.0','>=')) { $upd_error = $_FILES['up_file']['error']; } else { $upd_error = 0; } if($upd_error != 0) { switch ($upd_error) { case 1: case 2: $uerr[] = __('File size exceeds the authorized limit'); break; case 3: $uerr[] = __('File was only partially uploaded'); break; case 4: $uerr[] = __('No file'); break; } } elseif (file_exists($dest_file)) { $err = ''.__('Cannot upload: destination file exists.').'
'; } elseif (@move_uploaded_file($tmp_file,$dest_file) !== false) { chmod($dest_file,fileperms(dirname($dest_file)) & ~0111); header('Location: '.$p_url.'&f='.$dcFM->base_path); exit; } else { $err = ''.__('Cannot upload.').'
'; } if (count($uerr) > 0) { $err = ''.__('Cannot write file.').'
'; } } # Renommer un fichier/répertoire if (!empty($_GET['new_name']) && $dcFM->isParentWritable()) { if($dcFM->rename($_GET['new_name']) !== false) { header('Location: '.$p_url.'&f='.dirname($dcFM->base_path)); exit; } else { $err = ''.__('Cannot rename.').'
'; } } # Suppression d'un fichier if (!empty($_GET['del']) && $dcFM->isDeletable()) { if ($dcFM->delete() === true) { header('Location: '.$p_url.'&f='.dirname($dcFM->base_path)); exit; } else { $err = ''.__('Cannot delete.').'
'; } } } /* Affichage -------------------------------------------------------- */ buffer::str(''.__('Error(s)').' :
'. $err. ''.$dcFM->getNavBar().'
'); if (!$dcFM->isExclude() && ($f_list = $dcFM->getDir()) !== false) { $th_style=' style="border-bottom:1px solid #ccc;"'; buffer::str( ''.__('name').' | '. ''.__('size').' | '.__('date').' | '. '
---|
'.__('This file is not readable.').'
'); } else { if ($dcFM->isImg()) { buffer::str( 'base_path.'&dl=1" alt="" />' ); } else { if ($dcFM->isWritable()) { buffer::str( ''.__('This file is writable.').'
'. '' ); } else { buffer::str( ''.__('This file is not writable.').'
'. ''. htmlspecialchars($dcFM->getContent()). '