Changeset 1621
- Timestamp:
- 2008-02-25 14:00:14 (7 months ago)
- Location:
- FCKeditor/trunk/editor/filemanager/connectors/py
- Files:
-
- 2 modified
-
config.py (modified) (1 diff)
-
fckcommands.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/filemanager/connectors/py/config.py
r1565 r1621 65 65 # Allowed Resource Types 66 66 ConfigAllowedTypes = ['File', 'Image', 'Flash', 'Media'] 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 67 78 68 79 # Do not touch this 3 lines, see "Configuration settings for each Resource Type" -
FCKeditor/trunk/editor/filemanager/connectors/py/fckcommands.py
r1565 r1621 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): … … 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