FCKEditor v2.6 编辑器配置图解教程
发布时间:2024-01-04 22:16:05
标签:FCKEditor,配置教程
集成 FCKEditor v2.6(当前为最新版本)的基本步骤如下:
1. 下载FCKeditor 2.6 基本文件(Main Code)。将解压缩的文件复制到项目的editors/FCKEditorV2 目录下。
2. 下载 FCKeditor.Net / ASP.NET 控件,复制FredCK.FCKeditorV2.dll 文件到项目的bin目录。
这样就基本可以FCKEditor v2.6 超强的编辑器了,当然还需要在Host Settings中设置默认的编辑器。
关于 FCKEditor 的一些基本配置信息,请参考如下的文章:
如需要使用文件上传功能,还需要修改代码FCKEditorV2/editor/filemanager/connectors/config.ascx(以ASPX代码为例)。这里限制只有登录的用户才可以使用文件上传功能,并且上传的文件只能上传到用户自己的目录。根据每个用户名自动创建对应的文件上传目录。
connectors/config.ascx 更新后的代码如下:
/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*/
private string m_userName;
private int m_userID;
private int m_boardID;
private bool m_isAuthenticated;
private bool CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
//
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.
string userName = HttpContext.Current.User.Identity.Name;
try
{
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
string[] parts = userName.Split(';');
if (parts.Length == 3)
{
m_userID = int.Parse(parts[0]);
m_boardID = int.Parse(parts[1]);
m_userName = parts[2];
m_isAuthenticated = true;
}
}
}
catch (Exception)
{
m_userName = "";
m_userID = 0;
m_boardID = 0;
m_isAuthenticated = false;
}
return m_isAuthenticated;
}
public override void SetConfig()
{
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
Enabled = CheckAuthentication();
// URL path to user files.
UserFilesPath = "/userfiles/";
// The connector tries to resolve the above UserFilesPath automatically.
// Use the following setting it you prefer to explicitely specify the
// absolute path. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' URL must point to the same directory.
UserFilesAbsolutePath = "";
// Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled.
ForceSingleExtension = true;
// Allowed Resource Types
AllowedTypes = new string[] { "File", "Image", "Flash", "Media" };
// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
HtmlExtensions = new string[] { "html", "htm", "xml", "xsd", "txt", "js" };
TypeConfig[ "File" ].AllowedExtensions = new string[] { "7z", "aiff", "asf", "avi", "bmp", "csv", "doc", "fla", "flv", "gif", "gz", "gzip", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "ods", "odt", "pdf", "png", "ppt", "pxd", "qt", "ram", "rar", "rm", "rmi", "rmvb", "rtf", "sdc", "sitd", "swf", "sxc", "sxw", "tar", "tgz", "tif", "tiff", "txt", "vsd", "wav", "wma", "wmv", "xls", "xml", "zip" };
TypeConfig[ "File" ].DeniedExtensions = new string[] { };
string filepath = "%UserFilesPath%" + m_userName + "/file/";
TypeConfig["File"].FilesPath = filepath;
TypeConfig["File"].FilesAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/");
TypeConfig["File"].QuickUploadPath = filepath; // "%UserFilesPath%" + m_userName + "/";
TypeConfig["File"].QuickUploadAbsolutePath = filepath; // (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%");
TypeConfig[ "Image" ].AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
TypeConfig[ "Image" ].DeniedExtensions = new string[] { };
string imagepath = "%UserFilesPath%" + m_userName + "/image/";
TypeConfig["Image"].FilesPath = imagepath;
TypeConfig["Image"].FilesAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/");
TypeConfig["Image"].QuickUploadPath = imagepath; // "%UserFilesPath%" + m_userName + "/";
TypeConfig["Image"].QuickUploadAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%");
TypeConfig[ "Flash" ].AllowedExtensions = new string[] { "swf", "flv" };
TypeConfig[ "Flash" ].DeniedExtensions = new string[] { };
TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/";
TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Flash" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
TypeConfig[ "Media" ].AllowedExtensions = new string[] { "aiff", "asf", "avi", "bmp", "fla", "flv", "gif", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "png", "qt", "ram", "rm", "rmi", "rmvb", "swf", "tif", "tiff", "wav", "wma", "wmv" };
TypeConfig[ "Media" ].DeniedExtensions = new string[] { };
TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/";
TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Media" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
}
0
投稿
猜你喜欢
- 看下文章前我想先说一个问题遇到问题不要盲目的搜索答案,先看看终端提示什么错误,下面我总结一下会出现jupyter notebook运行命令,
- 本人最近在做字符识别,所以自行在网上寻找方法,接触到tesseract,自己按照网上方法做的时候,也遇到一些问题
- 在用户体验量化方法研究(一)中,我们以用户体验层次模型为基础,提出了三种量化用户体验的方法:以任务为中心、以行为为中心以及以体验为中心的量化
- 这是去年毕设做的一个Web漏洞扫描小工具,主要针对简单的SQL注入漏洞、SQL盲注和XSS漏洞,代码是看过github外国大神(听说是SMA
- 上篇关于爬虫的文章,我们讲解了如何运用Python的requests及BeautifuiSoup模块来完成静态网页的爬取,总结过程,网页爬虫
- 我是使用源码编译的方式安装的,网上有的可以添加 ppa 源进行在线安装,但我试了行不通,所以还是采用源码安装1、安装编译依赖项sudo ap
- 1.关系模型:用二维表格结构表示实体集,外键表示实体间联系的数据模型称为关系模型。关系模型是由若干个关系模式组成的集合。2.关系模式:关系模
- 本文实例讲述了Python基于回溯法解决01背包问题。分享给大家供大家参考,具体如下:同样的01背包问题,前面采用动态规划的方法,现在用回溯
- 验证码 在用户注册、登陆页面为了防止暴力请求,可以加入验证码。如果验证码错误,则不需要继续处理,可以减轻服务器的压力使用验证码也是一种有效防
- 前言使用的pyecharts是v1.0这里需要注意,pyecharts0.5的版本和v1.0以上的版本完全不一样,可以说是两个包该包能够方便
- 导读:这篇论坛文章主要介绍了使用SQL Server升级顾问的具体步骤,详细内容请参考下文。微软提供了SQL Server 2008升级顾问
- 一.pyinstaller简介pyinstaller将Python脚本打包成可执行程序,使在没有Python环境的机器上运行最新版是pyin
- 最近在上《自然语言处理》这门选修课,为了完成上机作业也是很认真了,这次是为了实现语角色标注任务,于是就入了这个坑,让我们来(快乐地 )解决出
- 今天小编来和大家聊一下Python当中的altair可视化模块,并且通过调用该模块来绘制一些常见的图表,借助Altair,我们可以将更多的精
- 做设计类网址导航的初衷是为了资源整合,也是在尝试解决问题。假定访问用户都是行业人士,或者目地性很强的有一定了解的用户,应该如何考虑这个组织系
- 使用穷举法求两个数的最大公约数for m in range (0,2): a = int(input("
- 前言python 可以做网站应用,也可以做客户端应用。但是客户端应用需要运行 py 脚本,如果用户不懂 python 就是一件比较麻烦的事情
- 因此为了节省服务器资源,应该尽可能关闭连接以释放连接所占有的资源,这种关闭记录集的连接而不关闭记录集的技术叫做断开记录集,这个记录集本身则称
- 如下所示:#统计某文件夹下的所有csv文件的行数(多线程)import threadingimport csvimport osclass
- lxml是python的一个解析库,支持HTML和XML的解析,支持XPath解析方式,而且解析效率非常高XPath,全称XML Path