Ticket #1873: 1873.patch

File 1873.patch, 1.7 kB (added by wwalc, 4 months ago)
  • editor/filemanager/connectors/py/config.py

     
    6565# Allowed Resource Types 
    6666ConfigAllowedTypes = ['File', 'Image', 'Flash', 'Media'] 
    6767 
     68# After file is uploaded, sometimes it is required to change its permissions 
     69# so that it was possible to access it at the later time. 
     70# If possible, it is recommended to set more restrictive permissions, like 0755. 
     71# Set to 0 to disable this feature. 
     72# Note: not needed on Windows-based servers. 
     73ChmodOnUpload = 0755 
     74 
    6875# Do not touch this 3 lines, see "Configuration settings for each Resource Type" 
    6976AllowedExtensions = {}; DeniedExtensions = {}; 
    7077FileTypesPath = {}; FileTypesAbsolutePath = {}; 
  • editor/filemanager/connectors/py/fckcommands.py

     
    168168                                                fout.close() 
    169169 
    170170                                                if os.path.exists ( newFilePath ): 
    171                                                         oldumask = os.umask(0) 
    172                                                         os.chmod( newFilePath, 0755 ) 
    173                                                         os.umask( oldumask ) 
     171                                                        doChmod = False 
     172                                                        try: 
     173                                                                doChmod = Config.ChmodOnUpload 
     174                                                                permissions = Config.ChmodOnUpload 
     175                                                        except AttributeError: #ChmodOnUpload undefined 
     176                                                                doChmod = True 
     177                                                                permissions = 0755 
     178                                                        if ( doChmod ): 
     179                                                                oldumask = os.umask(0) 
     180                                                                os.chmod( newFilePath, permissions ) 
     181                                                                os.umask( oldumask ) 
    174182 
    175183                                                newFileUrl = self.webUserFilesFolder + currentFolder + newFileName 
    176184