📄 password.asp
字号:
<!--#INCLUDE FILE="inc/db_inc.asp"-->
<!--#INCLUDE FILE="inc/md5_inc.asp"-->
<!--#INCLUDE FILE="inc/char_inc.asp"-->
<!--#INCLUDE FILE="header.asp"-->
<!--#INCLUDE FILE="inc/sendmail_inc.asp"-->
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Snowman Forum v2.0
'
' Copyright(C) Snowman, All rights reserved.
'
' http://www.xinboard.net
'
' Access版本免费, 欲使用SQL Server商业版本请购买使用权
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
dim StrSql, toptext, rs, rs2, StrHtml, error
StrHtml = loadtemplate("htmltop")
StrHtml = Replace(StrHtml, "{pagetitle}", loadtemplate("passwordtitle"))
StrHtml = Replace(StrHtml, "{style_path}", loadtemplate("path"))
StrHtml = Replace(StrHtml, "{forumtitle}", boardtitle)
response.write StrHtml
StrHtml = loadtemplate("pagetitle")
StrHtml = Replace(StrHtml, "{title_img}", "<img src=""style/" & loadtemplate("path") & "/image/title.gif"">")
if request.cookies("sf")("username") = "" then
toptext = loadtemplate("toptextguest")
else
toptext = loadtemplate("toptextuser")
end if
toptext = toptext & loadtemplate("toptext")
StrHtml = Replace(StrHtml, "{top_text}", toptext)
StrHtml = Replace(StrHtml, "{username}", request.cookies("sf")("username"))
response.write StrHtml
StrHtml = loadtemplate("pagepath")
StrHtml = Replace(StrHtml, "{path_text}", "<img src=""style/" & loadtemplate("path") & "/image/home.gif""><a href=index.asp>" & boardtitle & "</a> » " & loadtemplate("passwordtitle"))
response.write StrHtml
if allowsendemail = 0 then
StrHtml = loadtemplate("error")
StrHtml = Replace(StrHtml, "{error_text}", loadtemplate("err_allowsendemail"))
response.write StrHtml
response.end
end if
err = false
step = ChkSql(request("step"))
select case step
case "3"
if request("username") = "" then
err = true
else
username = ChkSql(request("username"))
err = false
if username = "" then
err = true
else
StrSql = "select top 1 userid, result, email from sf_user where username = '" & username & "'"
Set rs2 = Conn.execute(StrSql)
if rs2.bof or rs2.eof then
err = true
end if
end if
end if
if err then
StrHtml = loadtemplate("error")
StrHtml = Replace(StrHtml, "{error_text}", loadtemplate("err_usernotexist"))
response.write StrHtml
response.end
end if
' create a new 9 bit password:)
password = ""
Randomize
for i = 1 to 3
num1 = cstr(chr((90-65) * rnd + 65)) 'A~Z
num2 = cstr(chr((57-48) * rnd + 48)) '0~9
num3 = cstr(chr((122-97) * rnd + 97)) 'a~z
password = password & num1 & num2 & num3
next
' update password and send email...
if rs2("result") = md5(ChkSql(request("result"))) then
StrSql = "update sf_user set password = '" & md5(password) & "' where userid = " & rs2("userid")
Conn.execute(StrSql)
strtext = "ID:" & username & chr(10) & "Password:" & password
sf_sendmail rs2("email"), "Password", strtext
end if
StrHtml = loadtemplate("hint")
StrHtml = Replace(StrHtml, "{hint_text}", loadtemplate("hint_password"))
StrHtml = Replace(StrHtml, "{pro_name}", "index.asp")
response.write StrHtml
case "2"
if request("username") = "" then
err = true
else
username = ChkSql(request("username"))
err = false
if username = "" then
err = true
else
StrSql = "select question from sf_user where username = '" & username & "'"
Set rs2 = server.CreateObject("ADODB.RecordSet")
rs2.Open StrSql, Conn, 1, 1
if rs2.bof or rs2.eof then
err = true
end if
end if
end if
if err then
StrHtml = loadtemplate("error")
StrHtml = Replace(StrHtml, "{error_text}", loadtemplate("err_usernotexist"))
response.write StrHtml
response.end
end if
StrHtml = loadtemplate("password2")
StrHtml = Replace(StrHtml, "{question}", rs2("question") & "<input type=""hidden"" name=""username"" value=""" & request("username") & """>")
response.write StrHtml
rs2.close
Set rs2 = nothing
case else
response.write loadtemplate("password1")
response.write sfcopyright
end select
response.write loadtemplate("htmlbottom")
Conn.Close
Set Conn = nothing
Set rs = nothing
Set rs2 = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -