?? admin_pass.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="../md5.asp"-->
<%if session(hxCacheName&"_admin")<>"OK" then
response.redirect("admin_login.asp")
end if
if request.cookies(hxCacheName&"_rank")("rank")>1 then
response.write "<script language='javascript'>"
response.write "alert('您的級別不夠!');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
end if%>
<script language=javascript src=../images/mouse_on_title.js></script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
body {
background-color: #dadae9;
}
-->
</style>
</head>
<BODY background="images/back.gif">
<%dim admin,action,checktext,rs,sql,rank,user
admin=request("admin")
action=request("edit")
user=request.cookies(hxCacheName&"_ttlink")("administrator")
if action<>"ok" then
%>
<table width="98%" border="1"
style="border-collapse: collapse; border-style: dotted; border-width: 0px"
bordercolor="#333333" cellspacing="0" cellpadding="2">
<form action=admin_pass.asp method=post>
<tr class=backs><td colspan=2 class=td height=18>管理員密碼修改</td></tr>
<tr><td width=20% align=right height="18">管理員名稱</td>
<td><input type="text" readonly name="admin" size="20" value="<%=admin%>">
<img src=../images/memo.gif alt="管理員名稱不能修改<br>可添加新管理員后刪除老管理員"> </td></TR>
<tr><td width=20% align=right height="18">請您輸入新密碼</td>
<td><input type="password" name="Pass1" size="20" maxlength=15>
<img src=../images/memo.gif alt="密碼長度:8-16位<br>建議使用數(shù)字和字母組合"> </td></TR>
<tr><td width=20% align=right height="18">請您確認新密碼</td>
<td><input type="password" name="Pass2" size="20" maxlength=15>
<img src=../images/memo.gif alt="確認新密碼"> </td></TR>
<tr><td width=20% align=right height="18">管理級別</td>
<td> <select name="rank" size="1">
<option value="3">鏈接管理員</option>
<option value="2">普通管理員</option>
<option value="1">系統(tǒng)管理員</option>
</select>
<img src=../images/memo.gif alt="管理級別"> </td></TR>
<tr><td colspan=2><input type="submit" name="Submit" value="確認修改">
<input type="hidden" name="edit" value="ok"></td></tr>
</form>
</table>
<%
else
if trim(Request("pass1"))="" or trim(Request("pass2"))="" then
response.write "<script language='javascript'>"
response.write "alert('出錯了,填寫不完整,請?zhí)顚懪f密碼和新密碼!');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
if trim(Request("pass1"))<>trim(Request("pass2")) then
response.write "<script language='javascript'>"
response.write "alert('出錯了,兩次輸入的新密碼不符,請檢查后重新輸入!');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
if len(trim(Request("pass1")))<8 then
response.write "<script language='javascript'>"
response.write "alert('出錯了,您輸入的新密碼太短了,要求長度為8-16位,建議使用數(shù)字和字母組合!');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
'舊密碼正確以否判斷
'Set rs = conn.Execute("select * from admin where adminname='"&admin&"'")
'if rs("password")<>md5(Request("pass0")) then
'response.write "<script language='javascript'>"
'response.write "alert('出錯了,舊密碼不正確,請檢查后重新輸入!');"
'response.write "location.href='javascript:history.go(-1)';"
'response.write "</script>"
'response.end
'end if
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from admin where adminname='"&admin&"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<script language='javascript'>"
response.write "alert('操作失敗。您未登陸,或者閑置時間過長,或者數(shù)據(jù)庫中無此記錄。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
else
rs("password")=md5(Request("pass1"))
rs("rank")=Request("rank")
rs.update
end if
set rs=nothing
if user<>admin then
response.write "<script language='javascript'>"
response.write "alert('修改成功!');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
else
response.write "<script language='javascript'>"
response.write "alert('修改成功!\n\n現(xiàn)在將退出管理中心,請用新密碼重新登錄!');"
response.write "location.href='admin_login.asp?action=exit';"
response.write "</script>"
end if
end if
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -