FCKeditor编辑器实战技巧(3)
作者:柠檬园主 来源:3rgb.com 时间:2007-10-08 21:13:00
4、文件管理功能、文件上传的权限问题
一直以后FCKeditor的文件管理部分的安全是个值得注意,但很多人没注意到的地方,虽然FCKeditor在各个Release版本中一直存在的一个功能就是对上传文件类型进行过滤,但是她没考虑过另一个问题:到底允许谁能上传?到底谁能浏览服务器文件?
之前刚开始用FCKeditor时,我就出现过这个问题,还好NetRube(FCKeditor中文化以及FCKeditor ASP版上传程序的作者)及时提醒了我,做法是去修改FCK上传程序,在里面进行权限判断,并且再在fckconfig.js里把相应的一些功能去掉。但随之FCK版本的不断升级,每升一次都要去改一次配置程序fckconfig.js,我发觉厌烦了,就没什么办法能更好的控制这种配置么?事实上,是有的。
在fckconfig.js里面,有关于是否打开上传和浏览服务器的设置,在创建FCKeditor时,通过程序来判断是否创建有上传浏览功能的编辑器。首先,我先在fckconfig.js里面把所有的上传和浏览设置全设为false,接着我使用的代码如下:
ASP版本:
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
with oFCKeditor
.BasePath = fckPath
.Config("ToolbarLocation") = "Out:fckToolBar"
if request.cookies(site_sn)("issuper")="yes" then
.Config("LinkBrowser") = "true"
.Config("ImageBrowser") = "true"
.Config("FlashBrowser") = "true"
.Config("LinkUpload") = "true"
.Config("ImageUpload") = "true"
.Config("FlashUpload") = "true"
end if
.ToolbarSet = "Basic"
.Width = "100%"
.Height = "200"
.Value = ""
.Create "jcontent"
%>
JAVASCRIPT版本:
var oFCKeditor = new FCKeditor( 'fbContent' ) ;
<%if power = powercode then%>
oFCKeditor.Config['LinkBrowser'] = true ;
oFCKeditor.Config['ImageBrowser'] = true ;
oFCKeditor.Config['FlashBrowser'] = true ;
oFCKeditor.Config['LinkUpload'] = true ;
oFCKeditor.Config['ImageUpload'] = true ;
oFCKeditor.Config['FlashUpload'] = true ;
<%end if%>
oFCKeditor.ToolbarSet = 'Basic' ;
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '200' ;
oFCKeditor.Value = '' ;
oFCKeditor.Create() ;
'//--------------------------------------------------
'//原文:http://3rgb.com,作者:柠檬园主
'//转载请保留此信息
'//--------------------------------------------------
标签:编辑器,fckeditor,技巧
0
投稿
猜你喜欢
使用python+whoosh实现全文检索
2021-01-04 05:29:46
论坛首页效果图设计
2009-03-19 13:46:00
python爬取酷狗音乐排行榜
2021-01-24 19:43:49
Python提取频域特征知识点浅析
2021-10-31 08:01:31
SQL语句分组获取记录的第一条数据的方法
2012-08-21 10:58:39
python按比例随机切分数据的实现
2021-05-28 05:17:34
用javascript控制iframe滚动的代码
2024-02-25 19:56:00
sql server 中合并某个字段值的实例
2024-01-13 02:39:59
python中使用%与.format格式化文本方法解析
2023-09-21 18:02:11
详解Django将秒转换为xx天xx时xx分
2023-06-14 22:52:12
Vue3兄弟组件传值之mitt的超详细讲解
2023-07-02 16:56:04
ASP中CACHE缓存技术
2010-05-03 10:58:00
一些常用的JavaScript函数(json)附详细说明
2024-04-10 16:14:12
Python基于回溯法子集树模板实现图的遍历功能示例
2021-10-29 15:20:31
python 网络编程详解及简单实例
2021-09-02 06:40:56
使用python写一个自动浏览文章的脚本实例
2023-11-10 10:52:52
Python实现滑块验证码详解
2022-03-15 09:04:53
python定义具名元组实例操作
2023-05-16 22:22:55
javascript中select下拉框的用法总结
2024-04-19 09:57:51
python读写配置文件操作示例
2021-12-12 03:51:29