ewebeditor使用方法
下載下來,解壓到項(xiàng)目目錄下,修改解壓后的目錄名為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值相同,這樣便將兩者關(guān)聯(lián)起來。
style參數(shù)
有如下幾種可選參數(shù):standard、s_popup、s_newssystem、
ie8 eWebEditor按鈕點(diǎn)擊無效解決方案
在eWebEditor的目錄里找到Editor.js文件,
eWebEditor使用說明[轉(zhuǎn)載]
設(shè)置:
eWebEditor帶有后臺(tái)管理功能,你可以方便對(duì)樣式,上傳文件等進(jìn)行管理。設(shè)置請(qǐng)注意:
后臺(tái)管理的登錄地址:http://www.yoursite.com/ewebeditor/admin_login.asp
第一次安裝請(qǐng)用默認(rèn)用戶admin和密碼admin登陸后臺(tái),并進(jìn)入管理頁面更改管理用戶和密碼
建議安裝好后,更改數(shù)據(jù)庫名字,以免別人惡意下載,默認(rèn)數(shù)據(jù)名為db/ewebeditor.mdb,更改名字后請(qǐng)修改include/startup.asp文件中相關(guān)連接
系統(tǒng)自帶有幾個(gè)標(biāo)準(zhǔn)樣式,不允許修改,在你新增樣式時(shí),最好先預(yù)覽,然后通過“拷貝標(biāo)準(zhǔn)樣式”的方式,以達(dá)到快速新增樣式的目的,且不易出錯(cuò)
調(diào)用:
eWebEditor的調(diào)用是非常簡單,基本上只是在原來的使用中加入一行代碼。
標(biāo)準(zhǔn)調(diào)用:
<iframe ID="eWebEditor1" src="/ewebeditor.asp?id=content1&style=standard" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
參數(shù)說明:
/ewebeditor.asp應(yīng)改為你實(shí)際安裝的路徑
參數(shù)id:相關(guān)聯(lián)的表單項(xiàng)名,也就是提交保存頁要引用的表單項(xiàng)名,多個(gè)調(diào)用時(shí),請(qǐng)保證id不同,可參見后面例子
參數(shù)style:使用的樣式名,可以是標(biāo)準(zhǔn)的樣式名或自定義的樣式名,如果使用標(biāo)準(zhǔn)standard可留空
width,height:根據(jù)實(shí)際需要設(shè)置,eWebEditor將自動(dòng)調(diào)整與其適應(yīng)
在后臺(tái)管理中,可以得到每個(gè)樣式的最佳調(diào)用代碼
所有入口參數(shù):(即:eWebEditor.asp?后面的參數(shù))
id:相關(guān)聯(lián)的保存編輯內(nèi)容的表單項(xiàng)名,也就是提交保存頁要引用的表單項(xiàng)名
style:使用的樣式名,可以是標(biāo)準(zhǔn)的樣式名或自定義的樣式名,如果使用標(biāo)準(zhǔn)standard可留空
originalfilename:相關(guān)聯(lián)的保存上傳原文件名列表的表單項(xiàng)名,必須是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>
接口:前臺(tái)解釋(限制)擴(kuò)充功能說明:
此功能禁用某些標(biāo)簽,如出于安全考慮的Script標(biāo)簽,等。各版本可能有所不同,請(qǐng)參看實(shí)際文件中的說明:
Function eWebEditor_DeCode(s_Content, sFilters)
s_Content : 要轉(zhuǎn)換的數(shù)據(jù)字符串
s_Filters : 要過濾掉的格式集,用逗號(hào)分隔多個(gè)
使用例子如下:
先包含擴(kuò)展功能文件,以下路徑相應(yīng)更改
<!--#include file = "Include/DeCode.asp"-->
<%
'' 此例只過濾SCRIPT標(biāo)簽,即意味著內(nèi)容中的客戶端腳本不會(huì)生效,您可根據(jù)實(shí)際的需要加入其它標(biāo)簽。
sContent = eWebEditor_DeCode(sContent, "SCRIPT")
%>
文章出處:DIY部落(http://www.diybl.com/course/1_web/webjs/2008324/106687.html)
使用EWEBEDITOR:ADODB.Recordset 錯(cuò)誤 800a0e7d錯(cuò)誤的解決方案
錯(cuò)誤:ADODB.Recordset 錯(cuò)誤 ’800a0e7d’ 連接無法用于執(zhí)行此操作。在此上下文中它可能已被關(guān)閉或無效。 /web/admin/eWebEditor/ewebeditor.asp,行xxx 造成
解決方案
一
1:右鍵單擊才c盤(系統(tǒng)安裝分區(qū)),選擇屬性。
2:選擇“安全”頁。
3:點(diǎn)擊“添加”按鈕,輸入Power Users,確定。
4:點(diǎn)擊“高級(jí)”按鈕,選中“用在此顯示的可以應(yīng)用到子對(duì)象的項(xiàng)目替代所有子對(duì)象的權(quán)限項(xiàng)目”,一路確定即可。
二
如果還是無濟(jì)于事,本人在網(wǎng)上搜索到可以解決各種奇怪的方法大家不妨試下,也許會(huì)讓你豁然開朗哦 :) 在 c:/windows/下 有個(gè)temp文件夾 給它多點(diǎn)權(quán)限 說不定可以解決你的問題!!
修復(fù)eWebEditor漏洞需要注意以下幾個(gè)方面
第一步:下載eWebEditor2.8 修正版
下載地址http://ewebeditor.webasp.net/download.asp
解壓放到項(xiàng)目文件目錄下. 為了方便使用我把文件改名為ewebeditor
第二步:修改相關(guān)調(diào)用到編輯器的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表=>
在倒數(shù)的21行
B_Title 字段的值為”顯示或隱藏指導(dǎo)方針”修改為”插入系統(tǒng)分頁符”
B_Event 字段的值為” showBorders()”修改為” insert('SplitPage')”
打開 WebEditor/Include/Editor.js
在777行之前插入
case "SplitPage": // 插入分頁符
insertHTML("<HR sysPageSplitFlag>");
break;
2,修改編輯器上傳文件的保存路徑
打開eWebEditor_Style表
找到你使用的樣式所在的行,我用的是s_newssystem 修改 S_UploadDir 字段的值
我是改成/UpLoadFiles/
這樣我用編輯器上傳的圖片等都會(huì)在根目錄的UpLoadFiles文件夾下.
第四步:編輯器的安全性
1、應(yīng)及時(shí)修改該編輯器的默認(rèn)數(shù)據(jù)庫路徑(db)和數(shù)據(jù)庫名稱(ewebeditor.mdb),并在Include/Startup.asp中更改連接語句,防止數(shù)據(jù)庫被黑客非法下載,更改EWebEditor文件夾名稱為不容易猜測(cè)到的!
2、刪除目錄下所有以Admin開頭的.asp文件,防止黑客進(jìn)入后臺(tái)管理界面
3、修改樣式表中的文件上傳路徑,保護(hù)編輯器路徑不被直接看到,或者打開數(shù)據(jù)庫中的表eWebEditor_Style,修改 S_UploadDir內(nèi)容.比如"/UploadFile/"表示所有文件上傳到網(wǎng)站根目錄下的UploadFile目錄內(nèi),這樣讓一些人通過查看圖片地址不能直接看到編輯器的地址!
4、對(duì)Upload.asp語句進(jìn)行修改,防止黑客利用其上傳ASP木馬從而獲得WEB權(quán)限
在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、及時(shí)對(duì)網(wǎng)站服務(wù)器IIS配置中的應(yīng)用程序擴(kuò)展名映射進(jìn)行整理,確保其它類型的文件不能在服務(wù)器網(wǎng)站上運(yùn)行
EWebEditor漏洞改進(jìn)方法:
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
''***************************************************
''功能:實(shí)現(xiàn)字符長度的控制
''參數(shù):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登錄,請(qǐng)與管理員聯(lián)系!''); location.href=''../index.asp'';</script>"
end if
%>
2.更改EWebEditor文件夾名稱
3.修改EWebEditor管理后臺(tái)(用戶名/密碼/允許文件上傳類型)
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","**")(這個(gè)不建議,還是用上面其它人寫的過濾代碼吧)
5.修改EWebEditor的數(shù)據(jù)庫路徑,并在Include/Startup.asp中更改連接語句
聯(lián)系客服