ewebeditor使用总结

ewebeditor使用方法

下载下来,解压到项目目录下,修改解压后的目录名为newseditor,然后直接在程序中添加2行代码即可:

  <textarea name="Content" style="display:none;" rows="1" cols="20"></textarea> 
     <IFRAME ID="editor" SRC="../newseditor/ewebeditor.asp?id=Content&style=standard" FRAMEBORDER="0" SCROLLING="no" WIDTH="100%" HEIGHT="389"></IFRAME>-

  这里需要注意:textarea的name值需要与ewebeditor.asp?id=Content中的id值相同,这样便将两者关联起来。

 

  style参数

  有如下几种可选参数:standard、s_popup、s_newssystem、

ie8 eWebEditor按钮点击无效解决方案 

在eWebEditor的目录里找到Editor.js文件,

路径是webedit\Include\Editor.js 用记事本打开,在其中找到如下代码(第176行):
if (element.YUSERONCLICK) {
    eval(element.YUSERONCLICK + "anonymous()");
}

if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");

版本不同可能写法有点区别

将上面的代码替换为
if (element.YUSERONCLICK) {
  try {
   eval(element.YUSERONCLICK + "anonymous()");
  }
  catch(err) {
   eval(element.YUSERONCLICK + "onclick(event)");
  }
 }
或者(不过,还是上面这段代码更能够解决问题)
if(navigator.appVersion.match(/8./i)=='8.')
    {
      if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "onclick(event)");  
   }
else

   {
     if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
}
        

  eWebEditor使用说明[转载]   

设置:

eWebEditor带有后台管理功能,你可以方便对样式,上传文件等进行管理。设置请注意:

后台管理的登录地址:http://www.yoursite.com/ewebeditor/admin_login.asp
第一次安装请用默认用户admin和密码admin登陆后台,并进入管理页面更改管理用户和密码
建议安装好后,更改数据库名字,以免别人恶意下载,默认数据名为db/ewebeditor.mdb,更改名字后请修改include/startup.asp文件中相关连接
系统自带有几个标准样式,不允许修改,在你新增样式时,最好先预览,然后通过“拷贝标准样式”的方式,以达到快速新增样式的目的,且不易出错
 调用:

eWebEditor的调用是非常简单,基本上只是在原来的使用中加入一行代码。

标准调用:


<iframe ID="eWebEditor1" src="/ewebeditor.asp?id=content1&style=standard" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
参数说明:

/ewebeditor.asp应改为你实际安装的路径
参数id:相关联的表单项名,也就是提交保存页要引用的表单项名,多个调用时,请保证id不同,可参见后面例子
参数style:使用的样式名,可以是标准的样式名或自定义的样式名,如果使用标准standard可留空
width,height:根据实际需要设置,eWebEditor将自动调整与其适应
在后台管理中,可以得到每个样式的最佳调用代码
所有入口参数:(即:eWebEditor.asp?后面的参数)

id:相关联的保存编辑内容的表单项名,也就是提交保存页要引用的表单项名
style:使用的样式名,可以是标准的样式名或自定义的样式名,如果使用标准standard可留空
originalfilename:相关联的保存上传原文件名列表的表单项名,必须是input类型,可以带onchange事件[]


<HTML>
<BODY>
<Script Language=JavaScript>
function eWebEditorPopUp(style, form, field) {
        var oPopUp = window.open("PopUp.asp?style="+style+"&form="+form+"&field="+field, "PopUp"+form+field, "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes");
}
</Script>
<FORM ACTION="" METHOD="" NAME="myForm">
<TEXTAREA NAME="myField" COLS="50" ROWS="5"></TEXTAREA>
<INPUT TYPE="BUTTON" VALUE="HTML编辑" ONCLICK="eWebEditorPopUp(''s_popup'', ''myForm'', ''myField'')">
</FORM>
</BODY>
</HTML>
接口:前台解释(限制)扩充功能说明:

此功能禁用某些标签,如出于安全考虑的Script标签,等。各版本可能有所不同,请参看实际文件中的说明:

Function eWebEditor_DeCode(s_Content, sFilters)
s_Content : 要转换的数据字符串
s_Filters : 要过滤掉的格式集,用逗号分隔多个
使用例子如下:


先包含扩展功能文件,以下路径相应更改
<!--#include file = "Include/DeCode.asp"-->

<%
'' 此例只过滤SCRIPT标签,即意味着内容中的客户端脚本不会生效,您可根据实际的需要加入其它标签。
sContent = eWebEditor_DeCode(sContent, "SCRIPT")
%> 

文章出处:DIY部落(http://www.diybl.com/course/1_web/webjs/2008324/106687.html)

使用EWEBEDITOR:ADODB.Recordset 错误 800a0e7d错误的解决方案

错误:ADODB.Recordset 错误 ’800a0e7d’ 连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。 /web/admin/eWebEditor/ewebeditor.asp,行xxx 造成

解决方案

1:右键单击才c盘(系统安装分区),选择属性。
2:选择“安全”页。
3:点击“添加”按钮,输入Power Users,确定。
4:点击“高级”按钮,选中“用在此显示的可以应用到子对象的项目替代所有子对象的权限项目”,一路确定即可。


如果还是无济于事,本人在网上搜索到可以解决各种奇怪的方法大家不妨试下,也许会让你豁然开朗哦 :) 在 c:/windows/下 有个temp文件夹 给它多点权限 说不定可以解决你的问题!!

修复eWebEditor漏洞需要注意以下几个方面
第一步:下载eWebEditor2.8 修正版

下载地址http://ewebeditor.webasp.net/download.asp
解压放到项目文件目录下. 为了方便使用我把文件改名为ewebeditor

第二步:修改相关调用到编辑器的ASP文件

<****** ID="Editor" src="ewebeditor/ewebeditor.asp?Id=NewsContent&style=s_newssystem" frameborder="0" scrolling="no" width="100%" HEIGHT="100%"></******>


第三步:修改eWebEditor编辑器

1,使之支持插入分页符
打开eWebEditor/db/ewebeditor.mdb =>
打开eWebEditor_Button表=>
在倒数的21行
B_Title 字段的值为”显示或隐藏指导方针”修改为”插入系统分页符”
B_Event 字段的值为” showBorders()”修改为” insert('SplitPage')”
打开 WebEditor/Include/Editor.js
在777行之前插入
        case "SplitPage":                        // 插入分页符
                insertHTML("<HR sysPageSplitFlag>");
                break;
2,修改编辑器上传文件的保存路径
打开eWebEditor_Style表
找到你使用的样式所在的行,我用的是s_newssystem 修改 S_UploadDir 字段的值
我是改成/UpLoadFiles/
这样我用编辑器上传的图片等都会在根目录的UpLoadFiles文件夹下.

第四步:编辑器的安全性

  1、应及时修改该编辑器的默认数据库路径(db)和数据库名称(ewebeditor.mdb),并在Include/Startup.asp中更改连接语句,防止数据库被黑客非法下载,更改EWebEditor文件夹名称为不容易猜测到的!

  2、删除目录下所有以Admin开头的.asp文件,防止黑客进入后台管理界面

  3、修改样式表中的文件上传路径,保护编辑器路径不被直接看到,或者打开数据库中的表eWebEditor_Style,修改 S_UploadDir内容.比如"/UploadFile/"表示所有文件上传到网站根目录下的UploadFile目录内,这样让一些人通过查看图片地址不能直接看到编辑器的地址!

      4、对Upload.asp语句进行修改,防止黑客利用其上传ASP木马从而获得WEB权限

在Upload.asp文件里面,找到这句话sAllowExt = Replace(UCase(sAllowExt), "ASP", "")

把这句话替换为
Do While InStr(sAllowExt, "ASP") or InStr(sAllowExt, "CER") or InStr(sAllowExt, "ASA") or InStr(sAllowExt, "CDX") or InStr(sAllowExt, "HTR")
   sAllowExt = Replace(sAllowExt, "ASP", "")
   sAllowExt = Replace(sAllowExt, "CER", "")
   sAllowExt = Replace(sAllowExt, "ASA", "")
   sAllowExt = Replace(sAllowExt, "CDX", "")
   sAllowExt = Replace(sAllowExt, "HTR", "")
   sAllowExt = Replace(sAllowExt, "CGI", "")
   sAllowExt = Replace(sAllowExt, "ASPX", "")'
   sAllowExt = Replace(sAllowExt, "ASP .JPG", "")
   sAllowExt = Replace(sAllowExt, "CER .JPG", "")
   sAllowExt = Replace(sAllowExt, "ASA .JPG", "")
   sAllowExt = Replace(sAllowExt, "CDX .JPG", "")
   sAllowExt = Replace(sAllowExt, "HTR .JPG", "")
   sAllowExt = Replace(sAllowExt, "CGI .JPG", "")
   sAllowExt = Replace(sAllowExt, "ASPX .JPG", "") 
Loop

  5、及时对网站服务器IIS配置中的应用程序扩展名映射进行整理,确保其它类型的文件不能在服务器网站上运行

EWebEditor漏洞改进方法:

1.在EWebEditor中加入IP控制
<%
''建立连接
dim conn,connstr
connstr="driver={sql server};server=.;uid=yst06;pwd=yst06;database=yst06"
set conn=Server.Createobject("ADODB.Connection")
conn.open connstr
''***************************************************
''功能:实现字符长度的控制
''参数:cutstr
''***************************************************
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then
userip = Request.ServerVariables("REMOTE_ADDR")
end if
userip=cstr(userip)
''Response.write userip&"<br>"
''Response.write Instr(userip,"*")-2
''Response.End()
''ip="210.29.168.123"
''Response.write Instr(ip,"*")
''Response.end()
set rs=server.createobject("adodb.recordset")
sql="select * from IP where state=1"
rs.open sql,conn,1,1
do while not rs.eof
TrustIp = Trim(Rs("IP"))
if Instr(TrustIp,"*")=0 then
if TrustIp = userip then
UserIpTrusted = True
exit do
else
rs.movenext
end if
else
Position=Instr(TrustIp,"*")-2
if left(TrustIp,Position) = left(userip,Position) then
UserIpTrusted = True
exit do
else
rs.movenext
end if
end if
loop
if UserIpTrusted = False then
Response.write "<script language=''javascript''>alert(''非法的IP登录,请与管理员联系!''); location.href=''../index.asp'';</script>"
end if
%>
2.更改EWebEditor文件夹名称
3.修改EWebEditor管理后台(用户名/密码/允许文件上传类型)
4.修改EWebEditor中文件过滤类型asp,cer,cdx,htr,stm,asa(Upload.asp)
'' 任何情况下都不允许上传asp,CER,ASA,CDX,HTR,stm脚本文件
sAllowExt = Replace(Replace(Replace(Replace(Replace(Replace(UCase(sAllowExt), "ASP", "**"), "CER", "**"), "ASA", "**"), "CDX", "**"), "HTR", "**"),"stm","**")(这个不建议,还是用上面其它人写的过滤代码吧)
5.修改EWebEditor的数据库路径,并在Include/Startup.asp中更改连接语句


 

原文地址:https://www.cnblogs.com/pricks/p/1638785.html