Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/ImageObject.cfc
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/ImageObject.cfc (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/ImageObject.cfc (revision 738)
@@ -0,0 +1,273 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf5_connector.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf5_connector.cfm (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf5_connector.cfm (revision 738)
@@ -0,0 +1,308 @@
+
+
+
+
+
+
+
+
+
+
+
+ userFilesPath = config.userFilesPath;
+
+ if ( userFilesPath eq "" )
+ {
+ userFilesPath = "/userfiles/";
+ }
+
+ // make sure the user files path is correctly formatted
+ userFilesPath = replace(userFilesPath, "\", "/", "ALL");
+ userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
+ if ( right(userFilesPath,1) NEQ "/" )
+ {
+ userFilesPath = userFilesPath & "/";
+ }
+ if ( left(userFilesPath,1) NEQ "/" )
+ {
+ userFilesPath = "/" & userFilesPath;
+ }
+
+ // make sure the current folder is correctly formatted
+ url.currentFolder = replace(url.currentFolder, "\", "/", "ALL");
+ url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL');
+ if ( right(url.currentFolder,1) neq "/" )
+ {
+ url.currentFolder = url.currentFolder & "/";
+ }
+ if ( left(url.currentFolder,1) neq "/" )
+ {
+ url.currentFolder = "/" & url.currentFolder;
+ }
+
+ if ( find("/",getBaseTemplatePath()) neq 0 )
+ {
+ fs = "/";
+ }
+ else
+ {
+ fs = "\";
+ }
+
+ // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that
+ // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a
+ // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary.
+ if ( len(config.serverPath) )
+ {
+ serverPath = config.serverPath;
+
+ if ( right(serverPath,1) neq fs )
+ {
+ serverPath = serverPath & fs;
+ }
+ }
+ else
+ {
+ serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
+ }
+
+ xmlContent = ""; // append to this string to build content
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ i=1;
+ folders = "";
+ while( i lte qDir.recordCount ) {
+ if( not compareNoCase( qDir.type[i], "FILE" ))
+ break;
+ if( not listFind(".,..", qDir.name[i]) )
+ folders = folders & '';
+ i=i+1;
+ }
+
+ xmlContent = xmlContent & '' & folders & '';
+
+
+
+
+
+
+
+
+
+
+
+ i=1;
+ folders = "";
+ files = "";
+ while( i lte qDir.recordCount ) {
+ if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) {
+ folders = folders & '';
+ } else if( not compareNoCase( qDir.type[i], "FILE" ) ) {
+ fileSizeKB = round(qDir.size[i] / 1024);
+ files = files & '';
+ }
+ i=i+1;
+ }
+
+ xmlContent = xmlContent & '' & folders & '';
+ xmlContent = xmlContent & '' & files & '';
+
+
+
+
+
+
+
+
+
+
+ newFolderName = url.newFolderName;
+ if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) {
+ // Munge folder name same way as we do the filename
+ // This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8
+ newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all");
+ newFolderName = reReplace(newFolderName, "_{2,}", "_", "all");
+ newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all");
+ newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all");
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ '>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlHeader = '';
+ xmlHeader = xmlHeader & '';
+ xmlFooter = '';
+
+
+
+
+
+
+#xmlHeader##xmlContent##xmlFooter#
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf5_upload.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf5_upload.cfm (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf5_upload.cfm (revision 738)
@@ -0,0 +1,242 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ function SendUploadResults(errorNumber, fileUrl, fileName, customMsg)
+ {
+ WriteOutput('');
+ }
+
+
+
+
+
+
+
+
+
+ userFilesPath = config.userFilesPath;
+
+ if ( userFilesPath eq "" ) {
+ userFilesPath = "/userfiles/";
+ }
+
+ // make sure the user files path is correctly formatted
+ userFilesPath = replace(userFilesPath, "\", "/", "ALL");
+ userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
+ if ( right(userFilesPath,1) NEQ "/" ) {
+ userFilesPath = userFilesPath & "/";
+ }
+ if ( left(userFilesPath,1) NEQ "/" ) {
+ userFilesPath = "/" & userFilesPath;
+ }
+
+ // make sure the current folder is correctly formatted
+ url.currentFolder = replace(url.currentFolder, "\", "/", "ALL");
+ url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL');
+ if ( right(url.currentFolder,1) neq "/" ) {
+ url.currentFolder = url.currentFolder & "/";
+ }
+ if ( left(url.currentFolder,1) neq "/" ) {
+ url.currentFolder = "/" & url.currentFolder;
+ }
+
+ if (find("/",getBaseTemplatePath())) {
+ fs = "/";
+ } else {
+ fs = "\";
+ }
+
+ // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that
+ // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a
+ // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary.
+ if ( len(config.serverPath) ) {
+ serverPath = config.serverPath;
+
+ if ( right(serverPath,1) neq fs ) {
+ serverPath = serverPath & fs;
+ }
+ } else {
+ serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ errorNumber = 0;
+ fileName = cffile.ClientFileName;
+ fileExt = cffile.ServerFileExt;
+
+ // munge filename for html download. Only a-z, 0-9, _, - and . are allowed
+ if( reFind("[^A-Za-z0-9_\-\.]", fileName) ) {
+ fileName = reReplace(fileName, "[^A-Za-z0-9\-\.]", "_", "ALL");
+ fileName = reReplace(fileName, "_{2,}", "_", "ALL");
+ fileName = reReplace(fileName, "([^_]+)_+$", "\1", "ALL");
+ fileName = reReplace(fileName, "$_([^_]+)$", "\1", "ALL");
+ }
+
+ // When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename.
+ if( compare( cffile.ServerFileName, fileName ) ) {
+ counter = 0;
+ tmpFileName = fileName;
+ while( fileExists("#currentFolderPath##fileName#.#fileExt#") ) {
+ counter = counter + 1;
+ fileName = tmpFileName & '(#counter#)';
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_basexml.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_basexml.cfm (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_basexml.cfm (revision 738)
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_commands.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_commands.cfm (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_commands.cfm (revision 738)
@@ -0,0 +1,213 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sFileExt = GetExtension( sFileName ) ;
+ sFilePart = RemoveExtension( sFileName );
+ while( fileExists( sServerDir & sFileName ) )
+ {
+ counter = counter + 1;
+ sFileName = sFilePart & '(#counter#).' & CFFILE.ClientFileExt;
+ errorNumber = 201;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ while( i lte qDir.recordCount )
+ {
+ if( compareNoCase( qDir.type[i], "FILE" ) and not listFind( ".,..", qDir.name[i] ) )
+ {
+ folders = folders & '' ;
+ }
+ i = i + 1;
+ }
+
+ #folders#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ while( i lte qDir.recordCount )
+ {
+ if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind( ".,..", qDir.name[i] ) )
+ {
+ folders = folders & '' ;
+ }
+ else if( not compareNoCase( qDir.type[i], "FILE" ) )
+ {
+ fileSizeKB = round(qDir.size[i] / 1024) ;
+ files = files & '' ;
+ }
+ i = i + 1 ;
+ }
+
+ #folders#
+ #files#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sNewFolderName = SanitizeFolderName( sNewFolderName ) ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_connector.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_connector.cfm (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_connector.cfm (revision 738)
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_io.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_io.cfm (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_io.cfm (revision 738)
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +', "_", "all" )>
+
+
+
+
+
+
+
+
+
+ var chunk = "";
+ var fileReaderClass = "";
+ var fileReader = "";
+ var file = "";
+ var done = false;
+ var counter = 0;
+ var byteArray = "";
+
+ if( not fileExists( ARGUMENTS.fileName ) )
+ {
+ return "" ;
+ }
+
+ if (REQUEST.CFVersion gte 8)
+ {
+ file = FileOpen( ARGUMENTS.fileName, "readbinary" ) ;
+ byteArray = FileRead( file, 1024 ) ;
+ chunk = toString( toBinary( toBase64( byteArray ) ) ) ;
+ FileClose( file ) ;
+ }
+ else
+ {
+ fileReaderClass = createObject("java", "java.io.FileInputStream");
+ fileReader = fileReaderClass.init(fileName);
+
+ while(not done)
+ {
+ char = fileReader.read();
+ counter = counter + 1;
+ if ( char eq -1 or counter eq ARGUMENTS.bytes)
+ {
+ done = true;
+ }
+ else
+ {
+ chunk = chunk & chr(char) ;
+ }
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +', "_", "all" )>
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_upload.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_upload.cfm (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_upload.cfm (revision 738)
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_util.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_util.cfm (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/cf_util.cfm (revision 738)
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/config.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/config.cfm (revision 737)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/config.cfm (revision 738)
@@ -20,37 +20,113 @@
* == END LICENSE ==
*
- * Configuration file for the ColdFusion Connector.
+ * Configuration file for the ColdFusion Connector (all versions).
--->
+
- config = StructNew();
+ Config = StructNew() ;
// SECURITY: You must explicitly enable this "connector". (Set enabled to "true")
- config.enabled = false;
+ Config.Enabled = true ;
// Path to uploaded files relative to the document root.
- config.userFilesPath = "/userfiles/";
+ Config.UserFilesPath = "/userfiles/" ;
- // Use this to force the server path if FCKeditor is not running directly off
- // the root of the application or the FCKeditor directory in the URL is a virtual directory
+ // Use this to force the server path if FCKeditor is not running directly off
+ // the root of the application or the FCKeditor directory in the URL is a virtual directory
// or a symbolic link / junction
// Example: C:\inetpub\wwwroot\myDocs\
- config.serverPath = "";
+ Config.ServerPath = "" ;
- config.allowedExtensions = StructNew();
- config.deniedExtensions = StructNew();
+ // Due to security issues with Apache modules, it is reccomended to leave the
+ // following setting enabled.
+ Config.ForceSingleExtension = true ;
- config.allowedExtensions["File"] = "";
- config.deniedExtensions["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";
+ // Perform additional checks for image files - check whether uploaded images are valid image files
+ // 0 = turn off
+ // 1 = validate image size
+ // 2 = most secure option, validate images also against MIME Type Detection bug that
+ // can lead to Cross Site Scripting attacks (when image contains HTML tags in the first 1KB, some browsers may render it as a HTML file).
+ // Attention: it may produce false positives in some situations
+ Config.SecureImageUploads = 1;
- config.allowedExtensions["Image"] = "png,gif,jpg,jpeg,bmp";
- config.deniedExtensions["Image"] = "";
+ // What the user can do with this connector
+ Config.ConfigAllowedCommands = "QuickUpload,FileUpload,GetFolders,GetFoldersAndFiles,CreateFolder" ;
- config.allowedExtensions["Flash"] = "swf,fla";
- config.deniedExtensions["Flash"] = "";
+ //Allowed Resource Types
+ Config.ConfigAllowedTypes = "File,Image,Flash,Media" ;
- config.allowedExtensions["Media"] = "swf,fla,jpg,gif,jpeg,png,avi,mpg,mpeg,mp3,mp4,m4a,wma,wmv,wav,mid,midi,rmi,rm,ram,rmvb,mov,qt";
- config.deniedExtensions["Media"] = "";
+// Configuration settings for each Resource Type
+//
+// - AllowedExtensions: the possible extensions that can be allowed.
+// If it is empty then any file type can be uploaded.
+// - DeniedExtensions: The extensions that won't be allowed.
+// If it is empty then no restrictions are done here.
+//
+// For a file to be uploaded it has to fullfil both the AllowedExtensions
+// and DeniedExtensions (that's it: not being denied) conditions.
+//
+// - FileTypesPath: the virtual folder relative to the document root where
+// these resources will be located.
+// Attention: It must start and end with a slash: '/'
+//
+// - FileTypesAbsolutePath: the physical path to the above folder. It must be
+// an absolute path.
+// If it's an empty string then it will be autocalculated.
+// Usefull if you are using a virtual directory, symbolic link or alias.
+// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
+// Attention: The above 'FileTypesPath' must point to the same directory.
+// Attention: It must end with a slash: '/'
+//
+//
+// - QuickUploadPath: the virtual folder relative to the document root where
+// these resources will be uploaded using the Upload tab in the resources
+// dialogs.
+// Attention: It must start and end with a slash: '/'
+//
+// - QuickUploadAbsolutePath: the physical path to the above folder. It must be
+// an absolute path.
+// If it's an empty string then it will be autocalculated.
+// Usefull if you are using a virtual directory, symbolic link or alias.
+// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
+// Attention: The above 'QuickUploadPath' must point to the same directory.
+// Attention: It must end with a slash: '/'
+
+ Config.AllowedExtensions = StructNew() ;
+ Config.DeniedExtensions = StructNew() ;
+ Config.FileTypesPath = StructNew() ;
+ Config.FileTypesAbsolutePath = StructNew() ;
+ Config.QuickUploadPath = StructNew() ;
+ Config.QuickUploadAbsolutePath = StructNew() ;
+
+ Config.AllowedExtensions["File"] = "" ;
+ Config.DeniedExtensions["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" ;
+ Config.FileTypesPath["File"] = Config.UserFilesPath & 'file/' ;
+ Config.FileTypesAbsolutePath["File"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'file/') ) ;
+ Config.QuickUploadPath["File"] = Config.FileTypesPath["File"] ;
+ Config.QuickUploadAbsolutePath["File"] = Config.FileTypesAbsolutePath["File"] ;
+
+ Config.AllowedExtensions["Image"] = "png,gif,jpg,jpeg,bmp" ;
+ Config.DeniedExtensions["Image"] = "" ;
+ Config.FileTypesPath["Image"] = Config.UserFilesPath & 'image/' ;
+ Config.FileTypesAbsolutePath["Image"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'image/') ) ;
+ Config.QuickUploadPath["Image"] = Config.FileTypesPath["Image"] ;
+ Config.QuickUploadAbsolutePath["Image"] = Config.FileTypesAbsolutePath["Image"] ;
+
+ Config.AllowedExtensions["Flash"] = "swf,fla" ;
+ Config.DeniedExtensions["Flash"] = "" ;
+ Config.FileTypesPath["Flash"] = Config.UserFilesPath & 'flash/' ;
+ Config.FileTypesAbsolutePath["Flash"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'flash/') ) ;
+ Config.QuickUploadPath["Flash"] = Config.FileTypesPath["Flash"] ;
+ Config.QuickUploadAbsolutePath["Flash"] = Config.FileTypesAbsolutePath["Flash"] ;
+
+ Config.AllowedExtensions["Media"] = "swf,fla,jpg,gif,jpeg,png,avi,mpg,mpeg,mp3,mp4,m4a,wma,wmv,wav,mid,midi,rmi,rm,ram,rmvb,mov,qt" ;
+ Config.DeniedExtensions["Media"] = "" ;
+ Config.FileTypesPath["Media"] = Config.UserFilesPath & 'media/' ;
+ Config.FileTypesAbsolutePath["Media"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'media/') ) ;
+ Config.QuickUploadPath["Media"] = Config.FileTypesPath["Media"] ;
+ Config.QuickUploadAbsolutePath["Media"] = Config.FileTypesAbsolutePath["Media"] ;
+
@@ -82,4 +158,8 @@
+
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/connector.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/connector.cfm (revision 737)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/connector.cfm (revision 738)
@@ -1,3 +1,3 @@
-
+
-
-
-
-
-
-
-
-
-
- userFilesPath = config.userFilesPath;
-
- if ( userFilesPath eq "" ) {
- userFilesPath = "/userfiles/";
- }
-
- // make sure the user files path is correctly formatted
- userFilesPath = replace(userFilesPath, "\", "/", "ALL");
- userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
- if ( right(userFilesPath,1) NEQ "/" ) {
- userFilesPath = userFilesPath & "/";
- }
- if ( left(userFilesPath,1) NEQ "/" ) {
- userFilesPath = "/" & userFilesPath;
- }
-
- // make sure the current folder is correctly formatted
- url.currentFolder = replace(url.currentFolder, "\", "/", "ALL");
- url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL');
- if ( right(url.currentFolder,1) neq "/" ) {
- url.currentFolder = url.currentFolder & "/";
- }
- if ( left(url.currentFolder,1) neq "/" ) {
- url.currentFolder = "/" & url.currentFolder;
- }
-
- if ( find("/",getBaseTemplatePath()) neq 0 ) {
- fs = "/";
- } else {
- fs = "\";
- }
-
- // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that
- // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a
- // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary.
- if ( len(config.serverPath) ) {
- serverPath = config.serverPath;
-
- if ( right(serverPath,1) neq fs ) {
- serverPath = serverPath & fs;
- }
- } else {
- serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
- }
-
- // map the user files path to a physical directory
- userFilesServerPath = serverPath & url.type & replace(url.currentFolder,"/",fs,"all");
-
- xmlContent = ""; // append to this string to build content
-
-
-
-
- ">
-
-
-
- ">
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- i=1;
- folders = "";
- while( i lte qDir.recordCount ) {
- if( not compareNoCase( qDir.type[i], "FILE" ))
- break;
- if( not listFind(".,..", qDir.name[i]) )
- folders = folders & '';
- i=i+1;
- }
-
- xmlContent = xmlContent & '' & folders & '';
-
-
-
-
-
-
-
-
-
-
-
- i=1;
- folders = "";
- files = "";
- while( i lte qDir.recordCount ) {
- if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) {
- folders = folders & '';
- } else if( not compareNoCase( qDir.type[i], "FILE" ) ) {
- fileSizeKB = round(qDir.size[i] / 1024);
- files = files & '';
- }
- i=i+1;
- }
-
- xmlContent = xmlContent & '' & folders & '';
- xmlContent = xmlContent & '' & files & '';
-
-
-
-
-
-
-
-
-
-
- newFolderName = url.newFolderName;
- if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) {
- // Munge folder name same way as we do the filename
- // This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8
- newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all");
- newFolderName = reReplace(newFolderName, "_{2,}", "_", "all");
- newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all");
- newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all");
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- '>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- xmlHeader = '';
- xmlHeader = xmlHeader & '';
- xmlFooter = '';
-
-
-
-
-
-
-#xmlHeader##xmlContent##xmlFooter#
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/image.cfc
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/image.cfc (revision 738)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/image.cfc (revision 738)
@@ -0,0 +1,1325 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ paths = arrayNew(1);
+ paths[1] = expandPath("metadata-extractor-2.3.1.jar");
+ loader = createObject("component", "javaloader.JavaLoader").init(paths);
+
+ //at this stage we only have access to the class, but we don't have an instance
+ JpegMetadataReader = loader.create("com.drew.imaging.jpeg.JpegMetadataReader");
+
+ myMetaData = JpegMetadataReader.readMetadata(inFile);
+ directories = myMetaData.getDirectoryIterator();
+ while (directories.hasNext()) {
+ currentDirectory = directories.next();
+ tags = currentDirectory.getTagIterator();
+ while (tags.hasNext()) {
+ currentTag = tags.next();
+ if (currentTag.getTagName() DOES NOT CONTAIN "Unknown") { //leave out the junk data
+ queryAddRow(retQry);
+ querySetCell(retQry,"dirName",replace(currentTag.getDirectoryName(),' ','_','ALL'));
+ tagName = replace(currentTag.getTagName(),' ','','ALL');
+ tagName = replace(tagName,'/','','ALL');
+ querySetCell(retQry,"tagName",tagName);
+ querySetCell(retQry,"tagValue",currentTag.getDescription());
+ }
+ }
+ }
+ return retQry;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ resizedImage = CreateObject("java", "java.awt.image.BufferedImage");
+ at = CreateObject("java", "java.awt.geom.AffineTransform");
+ op = CreateObject("java", "java.awt.image.AffineTransformOp");
+
+ w = img.getWidth();
+ h = img.getHeight();
+
+ if (preserveAspect and cropToExact and newHeight gt 0 and newWidth gt 0)
+ {
+ if (w / h gt newWidth / newHeight){
+ newWidth = 0;
+ } else if (w / h lt newWidth / newHeight){
+ newHeight = 0;
+ }
+ } else if (preserveAspect and newHeight gt 0 and newWidth gt 0) {
+ if (w / h gt newWidth / newHeight){
+ newHeight = 0;
+ } else if (w / h lt newWidth / newHeight){
+ newWidth = 0;
+ }
+ }
+ if (newWidth gt 0 and newHeight eq 0) {
+ scale = newWidth / w;
+ w = newWidth;
+ h = round(h*scale);
+ } else if (newHeight gt 0 and newWidth eq 0) {
+ scale = newHeight / h;
+ h = newHeight;
+ w = round(w*scale);
+ } else if (newHeight gt 0 and newWidth gt 0) {
+ w = newWidth;
+ h = newHeight;
+ } else {
+ retVal = throw( retVal.errorMessage);
+ return retVal;
+ }
+ resizedImage.init(javacast("int",w),javacast("int",h),img.getType());
+
+ w = w / img.getWidth();
+ h = h / img.getHeight();
+
+
+
+ op.init(at.getScaleInstance(javacast("double",w),javacast("double",h)), rh);
+ // resizedImage = op.createCompatibleDestImage(img, img.getColorModel());
+ op.filter(img, resizedImage);
+
+ imgInfo = getimageinfo(resizedImage, "");
+ if (imgInfo.errorCode gt 0)
+ {
+ return imgInfo;
+ }
+
+ cropOffsetX = max( Int( (imgInfo.width/2) - (newWidth/2) ), 0 );
+ cropOffsetY = max( Int( (imgInfo.height/2) - (newHeight/2) ), 0 );
+ // There is a chance that the image is exactly the correct
+ // width and height and don't need to be cropped
+ if
+ (
+ preserveAspect and cropToExact
+ and
+ (imgInfo.width IS NOT specifiedWidth OR imgInfo.height IS NOT specifiedHeight)
+ )
+ {
+ // Get the correct offset to get the center of the image
+ cropOffsetX = max( Int( (imgInfo.width/2) - (specifiedWidth/2) ), 0 );
+ cropOffsetY = max( Int( (imgInfo.height/2) - (specifiedHeight/2) ), 0 );
+
+ cropImageResult = crop( resizedImage, "", "", cropOffsetX, cropOffsetY, specifiedWidth, specifiedHeight );
+ if ( cropImageResult.errorCode GT 0)
+ {
+ return cropImageResult;
+ } else {
+ resizedImage = cropImageResult.img;
+ }
+ }
+ if (outputFile eq "")
+ {
+ retVal.img = resizedImage;
+ return retVal;
+ } else {
+ saveImage = writeImage(outputFile, resizedImage, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if (fromX + newWidth gt img.getWidth()
+ OR
+ fromY + newHeight gt img.getHeight()
+ )
+ {
+ retval = throw( "The cropped image dimensions go beyond the original image dimensions.");
+ return retVal;
+ }
+ croppedImage = img.getSubimage(javaCast("int", fromX), javaCast("int", fromY), javaCast("int", newWidth), javaCast("int", newHeight) );
+ if (outputFile eq "")
+ {
+ retVal.img = croppedImage;
+ return retVal;
+ } else {
+ saveImage = writeImage(outputFile, croppedImage, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ rotatedImage = CreateObject("java", "java.awt.image.BufferedImage");
+ at = CreateObject("java", "java.awt.geom.AffineTransform");
+ op = CreateObject("java", "java.awt.image.AffineTransformOp");
+
+ iw = img.getWidth(); h = iw;
+ ih = img.getHeight(); w = ih;
+
+ if(arguments.degrees eq 180) { w = iw; h = ih; }
+
+ x = (w/2)-(iw/2);
+ y = (h/2)-(ih/2);
+
+ rotatedImage.init(javacast("int",w),javacast("int",h),img.getType());
+
+ at.rotate(arguments.degrees * 0.0174532925,w/2,h/2);
+ at.translate(x,y);
+ op.init(at, rh);
+
+ op.filter(img, rotatedImage);
+
+ if (outputFile eq "")
+ {
+ retVal.img = rotatedImage;
+ return retVal;
+ } else {
+ saveImage = writeImage(outputFile, rotatedImage, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if (outputFile eq "")
+ {
+ retVal = throw( "The convert method requires a valid output filename.");
+ return retVal;
+ } else {
+ saveImage = writeImage(outputFile, img, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /*
+ JPEG output method handles compression
+ */
+ out = createObject("java", "java.io.BufferedOutputStream");
+ fos = createObject("java", "java.io.FileOutputStream");
+ fos.init(tempOutputFile);
+ out.init(fos);
+ JPEGCodec = createObject("java", "com.sun.image.codec.jpeg.JPEGCodec");
+ encoder = JPEGCodec.createJPEGEncoder(out);
+ param = encoder.getDefaultJPEGEncodeParam(img);
+ param.setQuality(quality, false);
+ encoder.setJPEGEncodeParam(param);
+ encoder.encode(img);
+ out.close();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ flippedImage = CreateObject("java", "java.awt.image.BufferedImage");
+ at = CreateObject("java", "java.awt.geom.AffineTransform");
+ op = CreateObject("java", "java.awt.image.AffineTransformOp");
+
+ flippedImage.init(img.getWidth(), img.getHeight(), img.getType());
+
+ if (direction eq "horizontal") {
+ at = at.getScaleInstance(-1, 1);
+ at.translate(-img.getWidth(), 0);
+ } else {
+ at = at.getScaleInstance(1,-1);
+ at.translate(0, -img.getHeight());
+ }
+ op.init(at, rh);
+ op.filter(img, flippedImage);
+
+ if (outputFile eq "")
+ {
+ retVal.img = flippedImage;
+ return retVal;
+ } else {
+ saveImage = writeImage(outputFile, flippedImage, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ // initialize the blur filter
+ variables.blurFilter.init(arguments.blurAmount);
+ // move the source image into the destination image
+ // so we can repeatedly blur it.
+ destImage = srcImage;
+
+ for (i=1; i lte iterations; i=i+1)
+ {
+ // do the blur i times
+ destImage = variables.blurFilter.filter(destImage);
+ }
+
+
+ if (outputFile eq "")
+ {
+ // return the image object
+ retVal.img = destImage;
+ return retVal;
+ } else {
+ // write the image object to the specified file.
+ saveImage = writeImage(outputFile, destImage, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ // initialize the sharpen filter
+ variables.sharpenFilter.init();
+
+ destImage = variables.sharpenFilter.filter(srcImage);
+
+
+ if (outputFile eq "")
+ {
+ // return the image object
+ retVal.img = destImage;
+ return retVal;
+ } else {
+ // write the image object to the specified file.
+ saveImage = writeImage(outputFile, destImage, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ // initialize the posterize filter
+ variables.posterizeFilter.init(arguments.amount);
+
+ destImage = variables.posterizeFilter.filter(srcImage);
+
+
+ if (outputFile eq "")
+ {
+ // return the image object
+ retVal.img = destImage;
+ return retVal;
+ } else {
+ // write the image object to the specified file.
+ saveImage = writeImage(outputFile, destImage, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ // load objects
+ bgImage = CreateObject("java", "java.awt.image.BufferedImage");
+ fontImage = CreateObject("java", "java.awt.image.BufferedImage");
+ overlayImage = CreateObject("java", "java.awt.image.BufferedImage");
+ Color = CreateObject("java","java.awt.Color");
+ font = createObject("java","java.awt.Font");
+ font_stream = createObject("java","java.io.FileInputStream");
+ ac = CreateObject("Java", "java.awt.AlphaComposite");
+
+ // set up basic needs
+ fontColor = Color.init(javacast("int", rgb.red), javacast("int", rgb.green), javacast("int", rgb.blue));
+
+ if (fontDetails.fontFile neq "")
+ {
+ font_stream.init(arguments.fontDetails.fontFile);
+ font = font.createFont(font.TRUETYPE_FONT, font_stream);
+ font = font.deriveFont(javacast("float",arguments.fontDetails.size));
+ } else {
+ font.init(fontDetails.fontName, evaluate(fontDetails.style), fontDetails.size);
+ }
+ // get font metrics using a 1x1 bufferedImage
+ fontImage.init(1,1,img.getType());
+ g2 = fontImage.createGraphics();
+ g2.setRenderingHints(getRenderingHints());
+ fc = g2.getFontRenderContext();
+ bounds = font.getStringBounds(content,fc);
+
+ g2 = img.createGraphics();
+ g2.setRenderingHints(getRenderingHints());
+ g2.setFont(font);
+ g2.setColor(fontColor);
+ // in case you want to change the alpha
+ // g2.setComposite(ac.getInstance(ac.SRC_OVER, 0.50));
+
+ // the location (arguments.fontDetails.size+y) doesn't really work
+ // the way I want it to.
+ g2.drawString(content,javacast("int",x),javacast("int",arguments.fontDetails.size+y));
+
+ if (outputFile eq "")
+ {
+ retVal.img = img;
+ return retVal;
+ } else {
+ saveImage = writeImage(outputFile, img, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ at = CreateObject("java", "java.awt.geom.AffineTransform");
+ op = CreateObject("java", "java.awt.image.AffineTransformOp");
+ ac = CreateObject("Java", "java.awt.AlphaComposite");
+ gfx = originalImage.getGraphics();
+ gfx.setComposite(ac.getInstance(ac.SRC_OVER, alpha));
+
+ at.init();
+ // op.init(at,op.TYPE_BILINEAR);
+ op.init(at, rh);
+
+ gfx.drawImage(wmImage, op, javaCast("int",arguments.placeAtX), javacast("int", arguments.placeAtY));
+
+ gfx.dispose();
+
+ if (outputFile eq "")
+ {
+ retVal.img = originalImage;
+ return retVal;
+ } else {
+ saveImage = writeImage(outputFile, originalImage, jpegCompression);
+ if (saveImage.errorCode gt 0)
+ {
+ return saveImage;
+ } else {
+ return retVal;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ // convert the image to a specified BufferedImage type and return it
+
+ var width = bImage.getWidth();
+ var height = bImage.getHeight();
+ var newImage = createObject("java","java.awt.image.BufferedImage").init(javacast("int",width), javacast("int",height), javacast("int",type));
+ // int[] rgbArray = new int[width*height];
+ var rgbArray = variables.arrObj.newInstance(variables.intClass, javacast("int",width*height));
+
+ bImage.getRGB(
+ javacast("int",0),
+ javacast("int",0),
+ javacast("int",width),
+ javacast("int",height),
+ rgbArray,
+ javacast("int",0),
+ javacast("int",width)
+ );
+ newImage.setRGB(
+ javacast("int",0),
+ javacast("int",0),
+ javacast("int",width),
+ javacast("int",height),
+ rgbArray,
+ javacast("int",0),
+ javacast("int",width)
+ );
+ return newImage;
+
+
+
+
+
+
Index: /FCKeditor/trunk/editor/filemanager/connectors/cfm/upload.cfm
===================================================================
--- /FCKeditor/trunk/editor/filemanager/connectors/cfm/upload.cfm (revision 737)
+++ /FCKeditor/trunk/editor/filemanager/connectors/cfm/upload.cfm (revision 738)
@@ -1,2 +1,3 @@
+
-
-
-
-
-
-
-
-
+
+
+
-
-
- userFilesPath = config.userFilesPath;
-
- if ( userFilesPath eq "" ) {
- userFilesPath = "/userfiles/";
- }
-
- // make sure the user files path is correctly formatted
- userFilesPath = replace(userFilesPath, "\", "/", "ALL");
- userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
- if ( right(userFilesPath,1) NEQ "/" ) {
- userFilesPath = userFilesPath & "/";
- }
- if ( left(userFilesPath,1) NEQ "/" ) {
- userFilesPath = "/" & userFilesPath;
- }
-
- // make sure the current folder is correctly formatted
- url.currentFolder = replace(url.currentFolder, "\", "/", "ALL");
- url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL');
- if ( right(url.currentFolder,1) neq "/" ) {
- url.currentFolder = url.currentFolder & "/";
- }
- if ( left(url.currentFolder,1) neq "/" ) {
- url.currentFolder = "/" & url.currentFolder;
- }
-
- if (find("/",getBaseTemplatePath())) {
- fs = "/";
- } else {
- fs = "\";
- }
-
- // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that
- // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a
- // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary.
- if ( len(config.serverPath) ) {
- serverPath = config.serverPath;
-
- if ( right(serverPath,1) neq fs ) {
- serverPath = serverPath & fs;
- }
- } else {
- serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
- }
-
- // map the user files path to a physical directory
- userFilesServerPath = serverPath & url.type & replace(url.currentFolder,"/",fs,"all");
-
-
-
-
-
-
+