Ticket #1873: 1873_3.patch
File 1873_3.patch, 2.5 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
110 110 def createServerFolder(self, folderPath): 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 oldumask = os.umask(0) 114 os.makedirs(folderPath,mode=0755) 115 os.umask( oldumask ) 113 114 try: 115 permissions = Config.ChmodOnFolderCreate 116 if not permissions: 117 os.makedirs(folderPath) 118 except AttributeError: #ChmodOnFolderCreate undefined 119 permissions = 0755 120 121 if permissions: 122 oldumask = os.umask(0) 123 os.makedirs(folderPath,mode=0755) 124 os.umask( oldumask ) 116 125 117 126 class UploadFileCommandMixin (object): 118 127 def uploadFile(self, resourceType, currentFolder): … … 168 177 fout.close() 169 178 170 179 if os.path.exists ( newFilePath ): 171 oldumask = os.umask(0) 172 os.chmod( newFilePath, 0755 ) 173 os.umask( oldumask ) 180 doChmod = False 181 try: 182 doChmod = Config.ChmodOnUpload 183 permissions = Config.ChmodOnUpload 184 except AttributeError: #ChmodOnUpload undefined 185 doChmod = True 186 permissions = 0755 187 if ( doChmod ): 188 oldumask = os.umask(0) 189 os.chmod( newFilePath, permissions ) 190 os.umask( oldumask ) 174 191 175 192 newFileUrl = self.webUserFilesFolder + currentFolder + newFileName 176 193