Changeset 1626

Show
Ignore:
Timestamp:
2008-02-25 17:17:51 (7 months ago)
Author:
wwalc
Message:

Fix for #1872. Permissions applied with chmod commmand are now configurable (perl).

Location:
FCKeditor/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/filemanager/connectors/perl/commands.pl

    r1565 r1626  
    141141                        } else { 
    142142                                copy("$img_dir/$new_fname","$sFilePath"); 
    143                                 chmod(0777,$sFilePath); 
     143                                if (defined $CHMOD_ON_UPLOAD) { 
     144                                        if ($CHMOD_ON_UPLOAD) { 
     145                                                umask(000); 
     146                                                chmod($CHMOD_ON_UPLOAD,$sFilePath); 
     147                                        } 
     148                                } 
     149                                else { 
     150                                        umask(000); 
     151                                        chmod(0777,$sFilePath); 
     152                                } 
    144153                                unlink("$img_dir/$new_fname"); 
    145154                                last; 
  • FCKeditor/trunk/editor/filemanager/connectors/perl/io.pl

    r1565 r1626  
    8888        } 
    8989        if(!(-e $folderPath)) { 
    90                 umask(000); 
    91                 mkdir("$folderPath",0777); 
    92                 chmod(0777,"$folderPath"); 
     90                if (defined $CHMOD_ON_FOLDER_CREATE && !$CHMOD_ON_FOLDER_CREATE) { 
     91                        mkdir("$folderPath"); 
     92                } 
     93                else { 
     94                        umask(000); 
     95                        if (defined $CHMOD_ON_FOLDER_CREATE) { 
     96                                mkdir("$folderPath",$CHMOD_ON_FOLDER_CREATE); 
     97                        } 
     98                        else { 
     99                                mkdir("$folderPath",0777); 
     100                        } 
     101                } 
     102                                 
    93103                return(0); 
    94104        } else { 
  • FCKeditor/trunk/editor/filemanager/connectors/perl/upload_fck.pl

    r1565 r1626  
    2828# File size max(unit KB) 
    2929$MAX_CONTENT_SIZE =  30000; 
     30 
     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 = 0755; 
    3040 
    3141# Filelock (1=use,0=not use) 
     
    125135        my ($FORM) = @_; 
    126136 
    127  
    128         mkdir($img_dir,0777); 
    129         chmod(0777,$img_dir); 
     137        if (defined $CHMOD_ON_FOLDER_CREATE && !$CHMOD_ON_FOLDER_CREATE) { 
     138                mkdir("$img_dir"); 
     139        } 
     140        else { 
     141                umask(000); 
     142                if (defined $CHMOD_ON_FOLDER_CREATE) { 
     143                        mkdir("$img_dir",$CHMOD_ON_FOLDER_CREATE); 
     144                } 
     145                else { 
     146                        mkdir("$img_dir",0777); 
     147                } 
     148        }  
    130149 
    131150        undef $img_data_exists; 
  • FCKeditor/trunk/_whatsnew.html

    r1625 r1626  
    134134                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1871">#1871</a>] PHP file browser: permissions  
    135135                        applied with the chmod command are now configurable.</li> 
     136                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1872">#1872</a>] Perl file browser: permissions  
     137                        applied with the chmod command are now configurable.</li> 
    136138                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1873">#1873</a>] Python file browser: permissions  
    137139                        applied with the chmod command are now configurable.</li>