Ticket #1872: 1872.patch

File 1872.patch, 2.0 kB (added by wwalc, 4 months ago)
  • editor/filemanager/connectors/perl/commands.pl

     
    140140                                $sErrorNumber = '201'; 
    141141                        } else { 
    142142                                copy("$img_dir/$new_fname","$sFilePath"); 
    143                                 chmod(0777,$sFilePath); 
     143                                if ($CHMOD_ON_UPLOAD) { 
     144                                        chmod($CHMOD_ON_UPLOAD,$sFilePath); 
     145                                } 
    144146                                unlink("$img_dir/$new_fname"); 
    145147                                last; 
    146148                        } 
  • editor/filemanager/connectors/perl/io.pl

     
    8989        if(!(-e $folderPath)) { 
    9090                umask(000); 
    9191                mkdir("$folderPath",0777); 
    92                 chmod(0777,"$folderPath"); 
     92                if ($CHMOD_ON_FOLDER_CREATE) { 
     93                        chmod($CHMOD_ON_FOLDER_CREATE,"$folderPath"); 
     94                } 
    9395                return(0); 
    9496        } else { 
    9597                return(1); 
  • editor/filemanager/connectors/perl/upload_fck.pl

     
    2828# File size max(unit KB) 
    2929$MAX_CONTENT_SIZE =  30000; 
    3030 
     31# After file is uploaded, sometimes it is required to change its permissions 
     32# so that it was possible to access it at the later time. 
     33# If possible, it is recommended to set more restrictive permissions, like 0755. 
     34# Set to 0 to disable this feature. 
     35$CHMOD_ON_UPLOAD = 0777; 
     36 
     37# See comments above. 
     38# Used when creating folders that does not exist. 
     39$CHMOD_ON_FOLDER_CREATE = 0777; 
     40 
    3141# Filelock (1=use,0=not use) 
    3242$PM{'flock'}            = '1'; 
    3343 
     
    126136 
    127137 
    128138        mkdir($img_dir,0777); 
    129         chmod(0777,$img_dir); 
     139        if ($CHMOD_ON_FOLDER_CREATE) { 
     140                chmod($CHMOD_ON_FOLDER_CREATE,$img_dir); 
     141        } 
    130142 
    131143        undef $img_data_exists; 
    132144        undef @NEWFNAMES;