操作說明,請仔細閱讀操作說明后進行操作:
1、請把壓縮包中的key.asp文件上傳到KesionCMS根目錄下。
2、運行key.asp后選擇您所需要的選項。
3、注意:使用完畢后請點擊“刪除Key文件”或在FTP中刪除key.asp文件以防留有后門。
4、功能簡介:
A 在刪除了所有管理員情況下,新建管理員帳號。
B 修改后臺管理員的登錄名稱和密碼。
C 商業(yè)用戶注冊碼修改。
復制代碼 代碼如下:
%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
%option explicit
Response.Buffer=true%>
!--#include file="Conn.asp"-->
!--#include file="KS_Inc/md5.asp"-->
!--#include file="KS_Cls/KS.PublicCls.asp"-->
%
'****************************************************
' Software name:Kesion CMS 4.0
' Email: service@kesion.com . QQ:111394,9537636
' Web: http://www.kesion.com http://www.kesion.cn
' Copyright (C) Kesion Network All Rights Reserved.
'****************************************************
Dim KSCls
Set KSCls = New Install
KSCls.Kesion()
Set KSCls = Nothing
Class Install
Private KS
Private SqlStr,RS,InstallDir,FsoIndexFile,FsoIndexExt,AdminDirStr,CurrPath,Step
Private Sub Class_Initialize()
Set KS=New PublicCls
End Sub
Private Sub Class_Terminate()
Call CloseConn()
Set KS=Nothing
End Sub
Sub Kesion
%>
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
HTML xmlns="http://www.w3.org/1999/xhtml">HEAD>TITLE>科汛網站管理系統(tǒng)V4.0系列產品安裝程序/TITLE>
META http-equiv=Content-Type content="text/html; charset=GB2312">
script src="%=AdminDirStr%>/JS/Common.js" language="JavaScript">/script>
Script Language="javascript">
!--
function CheckForm()
{ var form=document.SetWebInfoForm;
if (form.UserName.value=="")
{
alert("請輸入管理賬號!");
form.UserName.focus();
return false;
}
if (form.PassWord.value=="")
{
alert("請輸入管理密碼!");
form.PassWord.focus();
return false;
}
if (form.ConPassWord.value=="")
{
alert("請輸入確認密碼!");
form.ConPassWord.focus();
return false;
}
if (form.ConPassWord.value!=form.PassWord.value)
{
alert("兩次輸入的密碼不一致!");
form.ConPassWord.focus();
return false;
}
if (form.SiteSN.value=="")
{
alert("請輸入授權系列號!");
form.SiteSN.focus();
return false;
}
if (form.SiteSN.value.length!=29form.SiteSN.value.length!=1)
{
alert("請輸入的授權系列號有誤!");
form.SiteSN.focus();
return false;
}
if (form.WebName.value=="")
{
alert("請輸入您的網站名稱!");
form.WebName.focus();
return false;
}
form.submit();
return true;
}
//-->
/Script>
style type="text/css">
!--
.STYLE1 {color: #FFFFFF}
A { TEXT-DECORATION: none; Color: #000000;}
A:hover { TEXT-DECORATION: none;Color: #4455aa; }
BODY {
text-align: center;
margin-top :20px;
SCROLLBAR-FACE-COLOR: #eeeeee;
SCROLLBAR-HIGHLIGHT-COLOR: #ffffff;
SCROLLBAR-SHADOW-COLOR: #dee3e7;
SCROLLBAR-3DLIGHT-COLOR: #d1d7dc;
SCROLLBAR-ARROW-COLOR: #000000;
SCROLLBAR-TRACK-COLOR: #ededed;
SCROLLBAR-DARKSHADOW-COLOR: #808080;
}
INPUT.text ,TEXTAREA ,subject ,SELECT {
BORDER: 1px gray solid;
PADDING-RIGHT: 1px;
PADDING-LEFT: 1px;
PADDING-BOTTOM: 1px;
PADDING-TOP: 1px;
HEIGHT: 19px;
}
TABLE {
WORD-BREAK: break-all;
}
body,td,th,div{
FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Tahoma; line-height: normal;
}
hr { height: 1px; color: #6595D6; width: 100%; }
.ContactInfo{
FONT-SIZE: 14px;
padding:5px;
color:#003399;
}
TEXTAREA.UpdateInfo{
border : 1px dotted #666666;
width:100%;
height:360px;
overflow: auto;
BACKGROUND-COLOR: #ffffff;
FONT-SIZE: 14px;
padding:5px;
color:#003399;
}
.copyright{
color:gray;
BACKGROUND-COLOR:#EAEAEA;
}
.redfont {color: #FF0000}
-->
/style>/HEAD>
BODY>
table width="700" border="1" align="center" cellpadding="1" cellspacing="6" bordercolor="#CCCCCC">
tr>
td width="682" height="22" bgcolor="#F0F0F0">TABLE width="98%" border=0 cellPadding=0 cellSpacing=1 class=Table1>
TBODY>
TR>
TH noWrap class=Link>A >演示站點/A>/TH>
TH width=404 align="center" noWrap class=Link>div align="right">strong>當前版本:/strong>V4.0strong> 官方版本: /strong>
script src="http://www.kesion.com/websystem/showver.asp">/script> /TH>
/TR>
/TBODY>
/TABLE> /td>
/tr>
tr>
td width="682" height="30" align="center" bgcolor="#333399">
table width="100%" border="0" cellspacing="0" cellpadding="0">
tr>
td>nbsp;/td>
td align="center">span class="STYLE1">strong>KesionCMS V4.0 Key管理員工具/strong>/span>/td>
/tr>
/table>/td>
/tr>
tr bgcolor="#F0F0F0" id="ShowSetup">
td height="250">
div style="color:red;font-weight:bold;text-align:center;padding:5px;">溫馨提示:為了系統(tǒng)的安全,請使用后一定要刪除該文件。/div>
br>
%select case request("action")
case "AddAdmin"
Call AddAdmin()
Case "AddSave"
Call SaveInfo()
Case "EditAdmin"
Call EditAdmin()
Case "EditSave"
Call EditSave()
Case "EditSiteSN"
Call EditSiteSN()
Case "EditSN"
Call EditSN()
Case "Del"
CurrPath = KS.Setting(3)
Call KS.DeleteFile(CurrPath"key.asp")
Response.Redirect KS.Setting(89) "Login.asp"
Case Else
Call Main()
End Select
%>
br>/td>
/tr>
/table>
table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
tr>
td height="10" align="right">nbsp;/td>
/tr>
tr>
td align="center" valign="bottom"> Powered bynbsp;a >strong> Kesion.Com /a>
copy; 2007
/td>
/tr>
/table>
TABLE class=Table0 cellSpacing=0 cellPadding=0 align=center border=0>
TBODY>
TR>
TD class=Table0 height=1>/TD>/TR>/TBODY>/TABLE>
!--結束部分-->
/BODY>
/HTML>
%
End Sub
Sub SaveInfo()
if not conn.execute("select username from ks_admin where SuperTF='1'").eof then
Call KS.AlertHistory("設置失敗:\n\n對不起,系統(tǒng)已存在超級管理賬號!","-1")
Response.End
end if
Dim PreUserName,UserName,PassWord,ConPassWord,UserRS
PreUserName=KS.S("PreUserName")
IF PreUserName="" then
Call KS.AlertHistory("設置失敗:\n\n沒有輸入前臺會員賬號,請輸入!","-1")
Response.End
End If
If Conn.Execute("Select * From KS_User Where UserName='" PreUserName "'").eof then
Call KS.AlertHistory("設置失敗:\n\n前臺用戶不存在,請重新輸入!","-1")
Response.End
end if
UserName=KS.S("UserName")
IF UserName="" then
Call KS.AlertHistory("設置失敗:\n\n沒有輸入管理賬號,請輸入!","-1")
Response.End
End If
PassWord=KS.S("PassWord")
IF PassWord="" then
Call KS.AlertHistory("設置失敗:\n\n沒有輸入管理密碼,請輸入!","-1")
Response.End
End If
IF Len(PassWord)6 then
Call KS.AlertHistory("設置失敗:\n\n密碼不能少于6位,請重新輸入!","-1")
Response.End
End If
ConPassWord=KS.S("ConPassWord")
IF PassWord>ConPassWord then
Call KS.AlertHistory("設置失敗:\n\n兩次輸入密碼不一致,請重新輸入!","-1")
Response.End
End If
PassWord =MD5(KS.R(Request.form("PassWord")),16)
Set UserRS=Server.CreateObject("ADODB.RECORDSET")
UserRS.Open "Select * From KS_Admin",Conn,1,3
UserRS.AddNew
UserRS("UserName")=UserName
UserRS("PrUserName")=UserName
UserRS("PassWord")=PassWord
UserRS("Sex")="男"
UserRS("Description")="科汛系統(tǒng)安裝分配的超級管理員"
UserRS("SuperTF")=1
UserRS("Locked")=0
UserRS("LastLoginIP")=KS.GetIP
UserRS("LoginTimes")=0
UserRS("LastLoginTime")=Now
UserRS("LastLogoutTime")=Now
UserRS("AddDate")=Now
UserRS("PowerList")=1
UserRS("ModelPower")="11111111111111111111"
UserRS.Update
UserRS.Close
Set UserRS=Nothing
Conn.Execute("Update KS_User Set GroupID=4 where username='" PreUserName "'")
KS.DelCaches(KS.SiteSN)
response.write "div align='center'>恭喜,后臺管理員設置成功!br>a href=""" KS.Setting(89) "login.asp"">進入后臺/a> | a href=""?action=Del"">刪除Key文件/a>/div>"
End Sub
Sub EditSave()
Dim UserName,password,conpassword
UserName=KS.S("UserName")
IF UserName="" then
Call KS.AlertHistory("設置失敗:\n\n沒有輸入管理賬號,請輸入!","-1")
Response.End
End If
Conn.Execute("Update KS_Admin Set UserName='" UserName "' Where Supertf='1'")
PassWord=KS.S("PassWord")
IF PassWord>"" then
IF Len(PassWord)6 then
Call KS.AlertHistory("設置失敗:\n\n密碼不能少于6位,請重新輸入!","-1")
Response.End
End If
ConPassWord=KS.S("ConPassWord")
IF PassWord>ConPassWord then
Call KS.AlertHistory("設置失敗:\n\n兩次輸入密碼不一致,請重新輸入!","-1")
Response.End
End If
PassWord =MD5(KS.R(Request.form("PassWord")),16)
Conn.Execute("Update KS_Admin Set [password]='" password "' Where Supertf='1'")
End If
response.write "div align='center'>恭喜,后臺管理員修改成功!br>a href=""" KS.Setting(89) "login.asp"">進入后臺/a> | a href=""?action=Del"">刪除Key文件/a>/div>"
End Sub
Sub EditSN()
Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
RS.Open "Select Setting From KS_Config",conn,1,3
Dim SetArr,SetStr,I
SetArr=Split(RS(0),"^%^")
For I=0 To Ubound(SetArr)
If I=0 Then
SetStr=SetArr(0)
ElseIf I=17 Then
SetStr=SetStr "^%^" request("sn")
Else
SetStr=SetStr "^%^" SetArr(I)
End If
Next
RS(0)=SetStr
RS.Update
RS.Close:Set RS=Nothing
Call KS.DelCahe(KS.SiteSn "_Config")
Call KS.DelCahe(KS.SiteSn "_Date")
response.write "div align='center'>恭喜,授權系統(tǒng)號修改成功!br>a href=""" KS.Setting(89) "login.asp"">進入后臺/a> | a href=""?action=Del"">刪除Key文件/a>/div>"
End Sub
Sub Main()
%>
table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#666666">
tr align="right">
td height="5" colspan="3" bgcolor="#0066CC">/td>
/tr>
form name="SetWebInfoForm" method="post" action="" onSubmit="return(CheckForm())">
input type="hidden" value="Save" name="Action">
tr>
td width="17%" height="35" align="right" bgcolor="#FFFFFF">strong>新建超級管理員:/strong>/td>
td width="41%" bgcolor="#FFFFFF">重新建立新的超級管理員帳號/td>
td width="42%" bgcolor="#FFFFFF">nbsp;
%dim rsc:set rsc=conn.execute("select username from ks_admin where SuperTF='1'")
if rsc.eof then%>
input type="button" value="開始新建" onClick="location.href='?action=AddAdmin';">
%else%>
input type="button" value="禁止新建" disabled>nbsp;font color=#a7a7a7>系統(tǒng)已存在%=rsc("username")%>的超級用戶/font>
%end if%>
/td>
/tr>
tr>
td height="35" align="right" bgcolor="#FFFFFF">strong>修改管理員:/strong>/td>
td bgcolor="#FFFFFF">修改超級管理員登錄名及登錄密碼/td>
td bgcolor="#FFFFFF">nbsp;
input name="button" type="button" value="開始修改" onClick="location.href='?action=EditAdmin';">/td>
/tr>
tr>
td height="35" align="right" bgcolor="#FFFFFF">strong>修改授權注冊碼:/strong>/td>
td bgcolor="#FFFFFF">修改官方授權唯一的注冊碼/td>
td bgcolor="#FFFFFF">nbsp;
input name="button2" type="button" value="開始修改" onClick="location.href='?action=EditSiteSN';">/td>
/tr>
tr align="right">
td height="5" colspan="3" bgcolor="#0066CC">/td>
/tr>
/form>
/table>
%
End Sub
Sub AddAdmin()
%>
table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#666666">
tr align="right">
td height="5" colspan="2" bgcolor="#0066CC">/td>
/tr>
form name="SetWebInfoForm" method="post" action="?action=AddSave">
tr>
td width="17%" height="35" align="right" bgcolor="#FFFFFF">strong>前臺用戶名:/strong>/td>
td width="41%" bgcolor="#FFFFFF">input type="text" name="preusername" size=12> (前臺注冊的用戶名)/td>
/tr>
tr>
td height="35" align="right" bgcolor="#FFFFFF">strong>管理員登錄名:/strong>/td>
td bgcolor="#FFFFFF">input type="text" name="username" size=12>/td>
/tr>
tr>
td height="35" align="right" bgcolor="#FFFFFF">strong>登錄密碼:/strong>/td>
td bgcolor="#FFFFFF">input type="password" name="password" size=12> (長度不能小于6)/td>
/tr>
tr>
td height="35" align="right" bgcolor="#FFFFFF">strong>確認密碼:/strong>/td>
td bgcolor="#FFFFFF">input type="password" name="conpassword" size=12> (長度不能小于6)/td>
/tr>
tr align="right">
td height="5" colspan="2" bgcolor="#0066CC">/td>
/tr>
tr align="center">
td height="25" colspan="2" bgcolor="#ffffff">input type="submit" value="確認增加">/td>
/tr>
/form>
/table>
%
End Sub
Sub EditAdmin()
%>
table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#666666">
tr align="right">
td height="5" colspan="2" bgcolor="#0066CC">/td>
/tr>
form name="SetWebInfoForm" method="post" action="?action=EditSave">
tr>
td height="35" align="right" bgcolor="#FFFFFF">strong>管理員登錄名:/strong>/td>
td bgcolor="#FFFFFF">input value="%=conn.execute("select username from ks_admin where supertf='1'")(0)%>" type="text" name="username" size=12>/td>
/tr>
tr>
td height="35" align="right" bgcolor="#FFFFFF">strong>登錄密碼:/strong>/td>
td bgcolor="#FFFFFF">input type="password" name="password" size=12> (長度不能小于6)不想修改請留空/td>
/tr>
tr>
td height="35" align="right" bgcolor="#FFFFFF">strong>確認密碼:/strong>/td>
td bgcolor="#FFFFFF">input type="password" name="conpassword" size=12> (長度不能小于6)不想修改請留空/td>
/tr>
tr align="right">
td height="5" colspan="2" bgcolor="#0066CC">/td>
/tr>
tr align="center">
td height="25" colspan="2" bgcolor="#ffffff">input type="submit" value="確認修改">/td>
/tr>
/form>
/table>
%
End Sub
Sub EditSiteSN()
%>
table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#666666">
tr align="right">
td height="5" colspan="2" bgcolor="#0066CC">/td>
/tr>
form name="SetWebInfoForm" method="post" action="?action=EditSN">
tr>
td height="35" align="right" bgcolor="#FFFFFF">strong>授權系統(tǒng)號:/strong>/td>
td bgcolor="#FFFFFF">input value="%=ks.setting(17)%>" type="text" name="sn" size=40>/td>
/tr>
tr align="right">
td height="5" colspan="2" bgcolor="#0066CC">/td>
/tr>
tr align="center">
td height="25" colspan="2" bgcolor="#ffffff">input type="submit" value="確認修改">/td>
/tr>
/form>
/table>
%
End Sub
End Class
%>