config.cfm
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:3k
源码类别:

OA系统

开发平台:

C#

  1. <cfsetting enablecfoutputonly="Yes">
  2. <cfscript>
  3. config = structNew();
  4. // SECURITY: You must explicitly enable this "connector". (Set enabled to "true")
  5. config.enabled = false;
  6. config.userFilesPath = "/UserFiles/";
  7. config.serverPath = ""; // 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
  8. config.allowedExtensions = structNew();
  9. config.deniedExtensions = structNew();
  10. // config.allowedExtensions["File"] = "doc,rtf,pdf,ppt,pps,xls,csv,vnd,zip";
  11. config.allowedExtensions["File"] = "";
  12. config.deniedExtensions["File"] = "php,php2,php3,php4,php5,phtml,pwml,inc,asp,aspx,ascx,jsp,cfm,cfc,pl,bat,exe,com,dll,vbs,js,reg,cgi,htaccess";
  13. config.allowedExtensions["Image"] = "png,gif,jpg,jpeg,bmp";
  14. config.deniedExtensions["Image"] = "";
  15. config.allowedExtensions["Flash"] = "swf,fla";
  16. config.deniedExtensions["Flash"] = "";
  17. 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";
  18. config.deniedExtensions["Media"] = "";
  19. </cfscript>
  20. <!--- code to maintain backwards compatibility with previous version of cfm connector --->
  21. <cfif isDefined("application.userFilesPath")>
  22. <cflock scope="application" type="readonly" timeout="5">
  23. <cfset config.userFilesPath = application.userFilesPath>
  24. </cflock>
  25. <cfelseif isDefined("server.userFilesPath")>
  26. <cflock scope="server" type="readonly" timeout="5">
  27. <cfset config.userFilesPath = server.userFilesPath>
  28. </cflock>
  29. </cfif>
  30. <!--- look for config struct in request, application and server scopes --->
  31. <cfif isDefined("request.FCKeditor") and isStruct(request.FCKeditor)>
  32. <cfset variables.FCKeditor = request.FCKeditor>
  33. <cfelseif isDefined("application.FCKeditor") and isStruct(application.FCKeditor)>
  34. <cflock scope="application" type="readonly" timeout="5">
  35. <cfset variables.FCKeditor = duplicate(application.FCKeditor)>
  36. </cflock>
  37. <cfelseif isDefined("server.FCKeditor") and isStruct(server.FCKeditor)>
  38. <cflock scope="server" type="readonly" timeout="5">
  39. <cfset variables.FCKeditor = duplicate(server.FCKeditor)>
  40. </cflock>
  41. </cfif>
  42. <cfif isDefined("FCKeditor")>
  43. <!--- copy key values from external to local config (i.e. override default config as required) --->
  44. <cfscript>
  45. function structCopyKeys(stFrom, stTo) {
  46. for ( key in stFrom ) {
  47. if ( isStruct(stFrom[key]) ) {
  48. structCopyKeys(stFrom[key],stTo[key]);
  49. } else {
  50. stTo[key] = stFrom[key];
  51. }
  52. }
  53. }
  54. structCopyKeys(FCKeditor, config);
  55. </cfscript>
  56. </cfif>