Changeset 389

Show
Ignore:
Timestamp:
2007-06-23 22:51:49 (18 months ago)
Author:
alfonsoml
Message:

Patch for #561, provide the ConfigFileTypesAbsolutePath setting for asp.

Location:
FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/config.asp

    r318 r389  
    2929ConfigIsEnabled = False 
    3030 
     31' @Packager.Remove.Start 
     32' Attention: In the development version (SVN) the ASP connector is enabled by default. 
    3133ConfigIsEnabled = true 
     34' @Packager.Remove.End 
     35 
    3236 
    3337' Path to user files relative to the document root. 
     38' This setting is preserved only for backward compatibility.  
     39' You should look at the settings for each resource type to get the full potential 
    3440Dim ConfigUserFilesPath 
    3541ConfigUserFilesPath = "/userfiles/" 
     
    6470'               Attention: It must start and end with a slash: '/' 
    6571' 
     72'       - FileTypesAbsolutePath: the physical path to the above folder. It must be 
     73'               an absolute path.  
     74'               If it's an empty string then it will be autocalculated. 
     75'               Usefull if you are using a virtual directory, symbolic link or alias.  
     76'               Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. 
     77'               Attention: The above 'FileTypesPath' must point to the same directory. 
     78'               Attention: It must end with a slash: '/' 
     79' 
    6680' - QuickUploadPath: the virtual folder relative to the document root where 
    6781'               these resources will be uploaded using the Upload tab in the resources  
     
    6983'               Attention: It must start and end with a slash: '/' 
    7084' 
     85'        - QuickUploadAbsolutePath: the physical path to the above folder. It must be 
     86'               an absolute path.  
     87'               If it's an empty string then it will be autocalculated. 
     88'               Usefull if you are using a virtual directory, symbolic link or alias.  
     89'               Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. 
     90'               Attention: The above 'QuickUploadPath' must point to the same directory. 
     91'               Attention: It must end with a slash: '/' 
     92' 
    7193 
    72 Dim ConfigAllowedExtensions, ConfigDeniedExtensions, ConfigFileTypesPath, ConfigQuickUploadPath 
     94Dim ConfigAllowedExtensions, ConfigDeniedExtensions, ConfigFileTypesPath, ConfigFileTypesAbsolutePath, ConfigQuickUploadPath, ConfigQuickUploadAbsolutePath 
    7395Set ConfigAllowedExtensions     = CreateObject( "Scripting.Dictionary" ) 
    7496Set ConfigDeniedExtensions      = CreateObject( "Scripting.Dictionary" ) 
    7597Set ConfigFileTypesPath = CreateObject( "Scripting.Dictionary" ) 
     98Set ConfigFileTypesAbsolutePath = CreateObject( "Scripting.Dictionary" ) 
    7699Set ConfigQuickUploadPath       = CreateObject( "Scripting.Dictionary" ) 
     100Set ConfigQuickUploadAbsolutePath       = CreateObject( "Scripting.Dictionary" ) 
    77101 
    78102ConfigAllowedExtensions.Add     "File", "" 
    79103ConfigDeniedExtensions.Add      "File", "html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi|htaccess|asis|sh|shtml|shtm|phtm" 
    80 ConfigFileTypesPath.Add "File", ConfigUserFilesPath & "file/" 
     104ConfigFileTypesPath.Add "File", "http://127.0.0.1/userfiles/file/" 
     105ConfigFileTypesAbsolutePath.Add "File", "d:\inetpub\wwwroot\docs\file\" 
    81106ConfigQuickUploadPath.Add "File", ConfigUserFilesPath 
     107ConfigQuickUploadAbsolutePath.Add "File", "" 
    82108 
    83109ConfigAllowedExtensions.Add     "Image", "jpg|gif|jpeg|png|bmp" 
    84110ConfigDeniedExtensions.Add      "Image", "" 
    85 ConfigFileTypesPath.Add "Image", ConfigUserFilesPath & "image/" 
     111ConfigFileTypesPath.Add "Image", "http://127.0.0.1/userfiles/image/" 
     112ConfigFileTypesAbsolutePath.Add "Image", "d:\inetpub\wwwroot\docs\image\" 
    86113ConfigQuickUploadPath.Add "Image", ConfigUserFilesPath 
     114ConfigQuickUploadAbsolutePath.Add "Image", "" 
    87115 
    88116ConfigAllowedExtensions.Add     "Flash", "swf|fla" 
    89117ConfigDeniedExtensions.Add      "Flash", "" 
    90118ConfigFileTypesPath.Add "Flash", ConfigUserFilesPath & "flash/" 
     119ConfigFileTypesAbsolutePath.Add "Flash", "" 
    91120ConfigQuickUploadPath.Add "Flash", ConfigUserFilesPath 
     121ConfigQuickUploadAbsolutePath.Add "Flash", "" 
    92122 
    93123ConfigAllowedExtensions.Add     "Media", "swf|fla|jpg|gif|jpeg|png|avi|mpg|mpeg|mp(1-4)|wma|wmv|wav|mid|midi|rmi|rm|ram|rmvb|mov|qt" 
    94124ConfigDeniedExtensions.Add      "Media", "" 
    95125ConfigFileTypesPath.Add "Media", ConfigUserFilesPath & "media/" 
     126ConfigFileTypesAbsolutePath.Add "Media", "" 
    96127ConfigQuickUploadPath.Add "Media", ConfigUserFilesPath 
     128ConfigQuickUploadAbsolutePath.Add "Media", "" 
    97129 
    98130%> 
  • FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/io.asp

    r318 r389  
    3434end Function 
    3535 
     36Function GetResourceTypeDirectory( resourceType, sCommand ) 
     37        if ( sCommand = "QuickUpload") then 
     38 
     39                if ( ConfigQuickUploadAbsolutePath.Item( resourceType ) <> "" ) then 
     40                        GetResourceTypeDirectory = ConfigQuickUploadAbsolutePath.Item( resourceType ) 
     41                else 
     42                        ' Map the "UserFiles" path to a local directory. 
     43                        GetResourceTypeDirectory = Server.MapPath( ConfigQuickUploadPath.Item( resourceType ) )  
     44                end if 
     45        else 
     46                if ( ConfigFileTypesAbsolutePath.Item( resourceType ) <> "" ) then  
     47                        GetResourceTypeDirectory = ConfigFileTypesAbsolutePath.Item( resourceType ) 
     48                else 
     49                        ' Map the "UserFiles" path to a local directory. 
     50                        GetResourceTypeDirectory = Server.MapPath( ConfigFileTypesPath.Item( resourceType ) )  
     51                end if 
     52        end if 
     53end Function 
     54 
    3655Function GetUrlFromPath( resourceType, folderPath, sCommand ) 
    3756        GetUrlFromPath = CombinePaths( GetResourceTypePath( resourceType, sCommand ), folderPath ) 
     
    4362 
    4463Function ServerMapFolder( resourceType, folderPath, sCommand ) 
    45         ' Map the "UserFiles" path to a local directory. 
    4664        Dim sResourceTypePath 
    47         sResourceTypePath = Server.MapPath( GetResourceTypePath( resourceType, sCommand ) ) 
     65        ' Get the resource type directory. 
     66        sResourceTypePath = GetResourceTypeDirectory( resourceType, sCommand )  
    4867 
    4968        ' Ensure that the directory exists.