Changeset 290
- Timestamp:
- 2007-05-05 23:59:07 (3 years ago)
- Location:
- FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors
- Files:
-
- 8 added
- 4 modified
-
asp/commands.asp (modified) (2 diffs)
-
asp/connector.asp (modified) (1 diff)
-
asp/io.asp (modified) (1 diff)
-
asp/upload.asp (modified) (1 diff)
-
php (added)
-
php/basexml.php (added)
-
php/commands.php (added)
-
php/config.php (added)
-
php/connector.php (added)
-
php/io.php (added)
-
php/upload.php (added)
-
php/util.php (added)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/commands.asp
r288 r290 33 33 Dim oFSO, oCurrentFolder, oFolders, oFolder 34 34 Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) 35 if not (oFSO.FolderExists( sServerDir ) ) then 36 Set oFSO = Nothing 37 SendError 102, currentFolder 38 end if 39 35 40 Set oCurrentFolder = oFSO.GetFolder( sServerDir ) 36 41 Set oFolders = oCurrentFolder.SubFolders … … 53 58 Dim oFSO, oCurrentFolder, oFolders, oFolder, oFiles, oFile 54 59 Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) 60 if not (oFSO.FolderExists( sServerDir ) ) then 61 Set oFSO = Nothing 62 SendError 102, currentFolder 63 end if 64 55 65 Set oCurrentFolder = oFSO.GetFolder( sServerDir ) 56 66 Set oFolders = oCurrentFolder.SubFolders -
FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/connector.asp
r288 r290 45 45 ' Get the main request information. 46 46 sCommand = Request.QueryString("Command") 47 48 sResourceType = Request.QueryString("Type") 49 If ( sResourceType = "" ) Then sResourceType = "File" 50 51 sCurrentFolder = GetCurrentFolder() 52 53 ' Check if it is an allowed command 47 54 if ( Not IsAllowedCommand( sCommand ) ) then 48 55 SendError 1, "The """ & sCommand & """ command isn't allowed" 49 56 end if 50 57 51 sResourceType = Request.QueryString("Type") 52 If ( sResourceType = "" ) Then sResourceType = "File" 53 54 sCurrentFolder = Request.QueryString("CurrentFolder") 55 If ( sCurrentFolder = "" ) Then sCurrentFolder = "/" 56 57 ' Check if it is an allower resource type. 58 ' Check if it is an allowed resource type. 58 59 if ( Not IsAllowedType( sResourceType ) ) Then 59 60 SendError 1, "The """ & sResourceType & """ resource type isn't allowed" 60 61 end if 61 62 ' Check the current folder syntax (must begin and start with a slash).63 If ( Right( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = sCurrentFolder & "/"64 If ( Left( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = "/" & sCurrentFolder65 66 ' Check for invalid folder paths (..)67 If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sResourceType, ".." ) <> 0 ) Then68 SendError 102, ""69 End If70 62 71 63 ' File Upload doesn't have to Return XML, so it must be intercepted before anything. -
FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/io.asp
r288 r290 140 140 End Function 141 141 142 function GetCurrentFolder() 143 { 144 dim sCurrentFolder 145 sCurrentFolder = Request.QueryString("CurrentFolder") 146 If ( sCurrentFolder = "" ) Then sCurrentFolder = "/" 147 148 ' Check the current folder syntax (must begin and start with a slash). 149 If ( Right( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = sCurrentFolder & "/" 150 If ( Left( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = "/" & sCurrentFolder 151 152 ' Check for invalid folder paths (..) 153 If ( InStr( 1, sCurrentFolder, ".." ) <> 0 ) Then 154 SendError 102, "" 155 End If 156 157 GetCurrentFolder = sCurrentFolder 158 end function 142 159 143 160 ' This is the function that sends the results of the uploading process. -
FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/upload.asp
r288 r290 41 41 42 42 sCommand = "FileUpload" 43 if ( Not IsAllowedCommand( sCommand ) ) then44 SendError 1, "The """ & sCommand & """ command isn't allowed"45 end if46 43 47 44 sResourceType = Request.QueryString("Type") 48 45 If ( sResourceType = "" ) Then sResourceType = "File" 49 46 50 sCurrentFolder = Request.QueryString("CurrentFolder") 51 If ( sCurrentFolder = "" ) Then sCurrentFolder = "/" 47 sCurrentFolder = GetCurrentFolder() 52 48 53 ' Check if it is an allower resource type. 49 ' Is Upload enabled? 50 if ( Not IsAllowedCommand( sCommand ) ) then 51 SendUploadResults "1", "", "", "The """ & sCommand & """ command isn't allowed" 52 end if 53 54 ' Check if it is an allowed resource type. 54 55 if ( Not IsAllowedType( sResourceType ) ) Then 55 56 SendUploadResults "1", "", "", "The " & sResourceType & " resource type isn't allowed" 56 57 end if 57 58 58 ' Check the current folder syntax (must begin and start with a slash).59 If ( Right( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = sCurrentFolder & "/"60 If ( Left( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = "/" & sCurrentFolder61 62 ' Check for invalid folder paths (..)63 If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sResourceType, ".." ) <> 0 ) Then64 SendUploadResults "102", "", "", "Invalid path"65 End If66 67 59 FileUpload sResourceType, sCurrentFolder 68 60