Ticket #1873: 1873_2.patch
File 1873_2.patch, 2.3 KB (added by , 16 years ago) |
---|
-
editor/filemanager/connectors/py/config.py
65 65 # Allowed Resource Types 66 66 ConfigAllowedTypes = ['File', 'Image', 'Flash', 'Media'] 67 67 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. 73 ChmodOnUpload = 0755 74 75 # See comments above. 76 # Used when creating folders that does not exist. 77 ChmodOnFolderCreate = 0755 78 68 79 # Do not touch this 3 lines, see "Configuration settings for each Resource Type" 69 80 AllowedExtensions = {}; DeniedExtensions = {}; 70 81 FileTypesPath = {}; FileTypesAbsolutePath = {}; -
editor/filemanager/connectors/py/fckcommands.py
111 111 "Purpose: physically creates a folder on the server" 112 112 # No need to check if the parent exists, just create all hierachy 113 113 oldumask = os.umask(0) 114 os.makedirs(folderPath,mode=0755) 114 try: 115 permissions = Config.ChmodOnFolderCreate 116 except AttributeError: #ChmodOnFolderCreate undefined 117 permissions = 0755 118 os.makedirs(folderPath,mode=permissions) 115 119 os.umask( oldumask ) 116 120 117 121 class UploadFileCommandMixin (object): … … 168 172 fout.close() 169 173 170 174 if os.path.exists ( newFilePath ): 171 oldumask = os.umask(0) 172 os.chmod( newFilePath, 0755 ) 173 os.umask( oldumask ) 175 doChmod = False 176 try: 177 doChmod = Config.ChmodOnUpload 178 permissions = Config.ChmodOnUpload 179 except AttributeError: #ChmodOnUpload undefined 180 doChmod = True 181 permissions = 0755 182 if ( doChmod ): 183 oldumask = os.umask(0) 184 os.chmod( newFilePath, permissions ) 185 os.umask( oldumask ) 174 186 175 187 newFileUrl = self.webUserFilesFolder + currentFolder + newFileName 176 188