?? modifypsw.asp
字號:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file="md5.asp"-->
<!--#include file="inc/chkinput.asp"-->
<%
'=========================================================
' File: modifypsw.asp
' Version:5.0
' Date: 2002-9-11
' Script Written by satan
'=========================================================
' Copyright (C) 2001,2002 AspSky.Net. All rights reserved.
' Web: http://www.aspsky.net,http://www.dvbbs.net
' Email: info@aspsky.net,eway@aspsky.net
'=========================================================
response.buffer=true
stats="修改密碼"
dim psw
dim password
dim oldpassword
dim quesion
dim answer
dim usercookies
call nav()
if Cint(GroupSetting(16))=0 then
Errmsg=Errmsg+"<br>"+"<li>您沒有在本論壇修改資料的權限,請<a href=login.asp>登陸</a>或者同管理員聯系。"
founderr=true
end if
if not founduser then
Errmsg=Errmsg+"<br>"+"<li>您還沒有登陸,請登陸后進行修改。"
founderr=true
end if
if founderr then
errmsg=errmsg+"<br>"+"<li>您沒有<a href=login.asp target=_blank>登錄</a>。"
call head_var(2,0,"","")
call dvbbs_error()
else
call head_var(0,0,membername & "的控制面板","usermanager.asp")
if request("action")="updat" then
call update()
if founderr then
call dvbbs_error()
else
sucmsg="<li>修改密碼成功!"
call dvbbs_suc()
end if
else
call userinfo()
end if
end if
call activeonline()
call footer()
sub userinfo()
set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where userid="&userid
rs.open sql,conn,1,1
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>該用戶名不存在。"
founderr=true
exit sub
else
%>
<table cellpadding=3 cellspacing=1 align=center class=tableborder1>
<tr>
<th width=14% height=25 id=tabletitlelink><a href=usermanager.asp>控制面板首頁</a></th>
<th width=14% id=tabletitlelink><a href=mymodify.asp>基本資料修改</a></th>
<th width=14% id=tabletitlelink><a href=modifypsw.asp>用戶密碼修改</a></th>
<th width=14% id=tabletitlelink><a href=modifyadd.asp>聯系資料修改</a></th>
<th width=14% id=tabletitlelink><a href=usersms.asp>用戶短信服務</a></th>
<th width=14% id=tabletitlelink><a href=friendlist.asp>編輯好友列表</a></th>
<th width=14% id=tabletitlelink><a href=favlist.asp>用戶收藏管理</a></th>
</tr>
</table>
<form action="modifypsw.asp?action=updat&username=<%=htmlencode(membername)%>" method=POST name="theForm">
<table cellpadding=3 cellspacing=1 align=center class=tableborder1>
<tr>
<th colspan="2" width="100%">用戶密碼資料
</th>
</tr>
<tr>
<td width="40%" class=tablebody1><B>舊密碼確認</B>:<BR>如要修改請輸入舊密碼進入確認</td>
<td width="60%" class=tablebody1>
<input type="password" name="oldpsw" value="" size=30 maxlength=13>
</td>
</tr>
<tr>
<td width="40%" class=tablebody1><B>新密碼確認</B>:<BR>如要修改請直接輸入新密碼進入更新</td>
<td width="60%" class=tablebody1>
<input type="password" name="psw" value="" size=30 maxlength=13>
</td>
</tr>
<tr>
<td width="40%" class=tablebody1><B>密碼問題</B>:<BR>請填寫做為密碼答案依據</td>
<td width="60%" class=tablebody1>
<input type=text name="quesion" size=30 value="<%=htmlencode(rs("quesion"))%>">
</td>
</tr>
<tr>
<td width="40%" class=tablebody1><B>問題答案</B>:<BR>請認真填寫以便您日后取回密碼<BR>答案采用了MD5加密,只供取回密碼使用,如要修改可直接填寫。</td>
<td width="60%" class=tablebody1>
<input type=text name="answer" size=30 value="<%=htmlencode(rs("answer"))%>">
<input type=hidden name="oldanswer" value="<%=htmlencode(rs("answer"))%>">
</td>
</tr>
<tr align="center">
<td colspan="2" width="100%" class=tablebody2>
<input type=Submit value="更 新" name="Submit"> <input type="reset" name="Submit2" value="清 除">
</td>
</tr>
</table></form>
</body>
</html>
<%
end if
rs.close
set rs=nothing
end sub
sub update()
set rs=server.createobject("adodb.recordset")
sql="Select userpassword from [User] where userid="&userid
set rs=conn.execute(sql)
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>該用戶名不存在。"
founderr=true
exit sub
else
if request("oldpsw")="" then
errmsg=errmsg+"<br>"+"<li>請輸入您的舊密碼,才能完成修改。"
founderr=true
exit sub
elseif md5(trim(request("oldpsw")))<>trim(rs("userpassword")) then
errmsg=errmsg+"<br>"+"<li>輸入的舊密碼錯誤,請重新輸入。"
founderr=true
exit sub
else
oldpassword=request("oldpsw")
end if
if request("psw")<>"" then
password=md5(request("psw"))
else
password=rs("userpassword")
end if
if request("quesion")="" then
errmsg=errmsg+"<br>"+"<li>請輸入密碼提示問題。"
founderr=true
exit sub
else
quesion=request("quesion")
end if
if request("answer")="" then
errmsg=errmsg+"<br>"+"<li>請輸入密碼提示問題答案。"
founderr=true
exit sub
elseif request("answer")=request("oldanswer") then
answer=request("answer")
else
answer=md5(request("answer"))
end if
end if
set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where userid="&userid
rs.open sql,conn,1,3
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>該用戶名不存在。"
founderr=true
exit sub
else
rs("userpassword")=password
rs("quesion")=quesion
rs("answer")=answer
rs.Update
Response.Cookies("aspsky")("password") = password
Response.Cookies("aspsky").path=cookiepath
end if
rs.close
set rs=nothing
end sub
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -