Exemple #1
0
$_SESSION['uuid'] = $uuid;
//现在每页已有的文件数
if (!isset($_SESSION['current_file_count'])) {
    $_SESSION['current_file_count'] = 20;
}
// $_SESSION['current_file_count']=20;
// echo "<script>alert('{$_SESSION['current_file_count']}')</script>";
//每次加载的文件递增数
if (!isset($_SESSION['file_load_step'])) {
    $_SESSION['file_load_step'] = 10;
}
//connect to mysql
$pdo = new PDO("mysql:dbname={$dbname};host={$host}", 'doc', 'doc');
$user = new userMgr($pdo);
$fm = new fileMgr($pdo);
$userPrivilege = $user->getPrivilege($uuid);
$userPrivilege = $userPrivilege['privilege'];
if ($userPrivilege === '0' || !$userPrivilege) {
    $delete_files = FALSE;
    $create_folders = TRUE;
    $delete_folders = FALSE;
    $rename_files = FALSE;
    $rename_folders = FALSE;
    $copy_cut_files = FALSE;
    // for copy/cut files
    $copy_cut_dirs = FALSE;
    // for copy/cut directories
    $preview_text_files = TRUE;
    // eg.: txt, log etc.
    $edit_text_files = FALSE;
    // eg.: txt, log etc.
Exemple #2
0
 }
 $targetFile = $targetPath . $_FILES['file']['name'];
 $targetFileThumb = $targetPathThumb . $_FILES['file']['name'];
 // check if image (and supported)
 if (in_array(fix_strtolower($info['extension']), $ext_img)) {
     $is_img = TRUE;
 } else {
     $is_img = FALSE;
 }
 // uploadfmysql/sql.php
 // $targetFile=iconv("gb2312","utf-8",$targetFile);
 move_uploaded_file($tempFile, $targetFile);
 chmod($targetFile, 0755);
 $sqlResult = $fm->upload($uid, $targetFile, $info['extension'], $tags);
 file_put_contents("new_upload_file.fm", $targetFile);
 $userPrivilege = $u->getPrivilege($uid);
 $userPrivilege = $userPrivilege['privilege'];
 if ($userPrivilege === '0') {
     $fm->noDisplay($targetFile);
 }
 if ($is_img) {
     $memory_error = FALSE;
     if (!create_img($targetFile, $target0FileThumb, 122, 91)) {
         $memory_error = FALSE;
     } else {
         // TODO something with this long function baaaah...
         if (!new_thumbnails_creation($targetPath, $targetFile, $_FILES['file']['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $relative_image_creation_option, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height, $fixed_image_creation_option)) {
             $memory_error = FALSE;
         } else {
             $imginfo = getimagesize($targetFile);
             $srcWidth = $imginfo[0];