?? lostpass.asp
字號(hào):
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% response.Buffer = false
'****************************************************************
'* joinboard BBS Ver2.3.0/友盟論壇 Ver2.3.0
'*
'* 版權(quán)所有: JoinBoard V2.3
'*
'* 程序制作: 友盟工作室
'*
'* 主頁地址: http://joinboard.com 友盟論壇
'*
'* 論壇地址: http://joinboard.com/joinboard/、 http://youmeng.com
'*
'****************************************************************
'* Powered by: JoinBoard V2.3
'* Copyright 2003-2004. - All Rights Reserved.
'* JoinBoard is a trademark of YouMeng Studio.
'****************************************************************
%>
<!--#include file="admin/BBSConfig.asp"-->
<!--#include file="INC/online.asp"-->
<!--#include file="INC/ShowMsg.asp"-->
<!--#include file="INC/header.asp"-->
<!--#include file="INC/style.asp"-->
<!--#include file="admin/md5.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="joinboard,forum,bbs,youmeng,友盟論壇">
<title><%=BBS_Config(0)%> - 找回密碼</title>
<link href="<%=Css_path%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%
Call onlineuser()
call top()
response.Write "<table border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" class=""path-table"">"
response.Write "<tr><td>"
response.write "<img src="""& BBS_Skin(3) &"JBB_bullet.gif""> <a href="""& BBSHomeUrl &""">"& BBS_Config(0) &"</a> <img src="""& BBS_Skin(3) &"JBB_bullet.gif""> <strong>找回密碼</strong>"
response.Write "</td></tr></table>"
action = trim(request.QueryString("action"))
select case action
case "sendmail"
Call sendmail()
case "sendok"
Call sendok()
case "reset"
Call reset()
case "resetok"
Call resetok()
case else
Call lostpass()
End select
'========================
Sub resetok()
username = Trim(Request.form("username"))
oldpass = Trim(Request.form("oldpass"))
if username = "" Or Len(oldpass) <> 16 then
ShowMsg "參數(shù)錯(cuò)誤!~請(qǐng)重新復(fù)制郵件中的網(wǎng)址到瀏覽器地址欄!~"
Call Bottom()
response.end
End if
userpass = Trim(Request.form("userpass"))
if userpass = "" then
ShowMsg "請(qǐng)輸入您的新密碼<br><br><a href=""javascript:history.back()""><<< 返回上一步</a>"
Call Bottom()
response.end
End if
userpass2 = Trim(Request.form("userpass2"))
if userpass <> userpass2 then
ShowMsg "您兩次輸入的密碼不一致!~<br><br><a href=""javascript:history.back()""><<< 返回上一步</a>"
Call Bottom()
response.end
End if
set rs = server.CreateObject("adodb.recordset")
rs.open "select userid,userpass From JBB_user where username='"& username &"' and userpass ='"& oldpass &"'",conn,1,3
if rs.eof or rs.bof then
RS.CLOSE
SET RS = NOTHING
ShowMsg "用戶名不存在或者網(wǎng)址參數(shù)錯(cuò)誤,請(qǐng)嘗試重新復(fù)制郵件中的網(wǎng)址到瀏覽器地址欄!~"
Call Bottom()
response.end
else
rs("userpass") = Md5(userpass)
rs.update
End if
RS.CLOSE
SET RS = NOTHING
ShowMsg "恭喜您,您的新密碼重置成功!~請(qǐng)點(diǎn)擊 <a href=""login.asp"">這里</a> 使用您的新密碼登錄論壇!"
End Sub
'========================
Sub sendmail()
username = Trim(Request.Form("username"))
if username = "" then
ShowMsg "<font color=""#FF0000"">請(qǐng)輸入你的用戶名</font><br><br><a href=""javascript:history.back()""><<< 返回上一步</a>"
Call Bottom()
response.end
End if
set rs = server.CreateObject("adodb.recordset")
rs.open "select email,usergroup,userpass from JBB_user where username = '"& username &"'",conn,1,1
if rs.eof or rs.bof then
rs.close
set rs = Nothing
ShowMsg "<font color=""#FF0000"">用戶名不正確,請(qǐng)重新輸入!~</font><br><br><a href=""javascript:history.back()""><<< 返回上一步</a>"
Call Bottom()
response.end
else
if trim(rs("usergroup")) = 1 then
rs.close
set rs = Nothing
ShowMsg "<font color=""#FF0000"">為了論壇的安全起見,管理員密碼不可找回!~</font><br><br><a href=""javascript:history.back()""><<< 返回上一步</a> | <a href=""index.asp""> 返回首頁</a>"
Call Bottom()
response.end
End if
if right(BBS_Config(1),1)<> "/" then
BBS_Config(1) = Board_url+"/"
End if
ShowMsg "正在發(fā)送郵件,請(qǐng)稍候..."
mailbody = username+",您好:"+ chr(13) + chr(13) &" 歡迎您使用本論壇的密碼遺忘功能,請(qǐng)復(fù)制下面的連接到瀏覽器地址欄,重新設(shè)置您的密碼。" + chr(13) + chr(13) & " " + BBS_Config(1) + "lostpass.asp?action=reset&username="+ username +"&userpass="+ rtrim(rs("userpass")) + chr(13) + chr(13) & "------------------------------------------------------------------"+ chr(13) & " Copyright © 2003, 2004 "+ BBS_Config(0) +" <"+ BBS_Config(1) +"> "+chr(13)+"Powered by:JoinBoard <http://www.JoinBoard.Net>"
useremail = rtrim(rs("email"))
'------------------------------------------------
set rs1=conn.execute("select top 1 sendEmailuser,sendmailPass,sendmailserver from JBB_config")
sendEmailuser=rs1(0)
sendmailPass=rs1(1)
sendmailserver=rs1(2)
set rs1 = nothing
'----------------------------------------------------
Set msg = Server.CreateObject("JMail.Message")
msg.silent = true
msg.Logging = true
msg.Charset = "gb2312"
msg.MailServerUserName = sendEmailuser '輸入smtp服務(wù)器驗(yàn)證登陸名 (郵局中任何一個(gè)用戶的Email地址)
msg.MailServerPassword = sendmailPass '輸入smtp服務(wù)器驗(yàn)證密碼 (用戶Email帳號(hào)對(duì)應(yīng)的密碼)
msg.From = BBS_Config(4) '發(fā)件人Email
msg.FromName = BBS_Config(0) '發(fā)件人姓名
msg.AddRecipient useremail '收件人Email
msg.Subject = "找回您在 "& BBS_Config(0) &" 的密碼" '信件主題
msg.Body = mailbody '正文
msg.Send (sendmailserver) 'smtp服務(wù)器地址(企業(yè)郵局地址)
set msg = nothing
'發(fā)信完畢
'------------------------------------------------
End if
rs.close
set rs = Nothing
response.Write("<meta HTTP-EQUIV=REFRESH CONTENT='0; URL=?action=sendok'>")
End sub
'========================
Sub sendok
ShowMsg"系統(tǒng)已經(jīng)發(fā)一封郵件到您注冊(cè)時(shí)填寫的郵箱,<br>請(qǐng)打開郵件中的密碼重設(shè)地址,重新設(shè)置您的密碼。<br><br><a href=""index.asp"">返回首頁</a>"
End Sub
'========================
Sub reset()
username = Trim(Request.QueryString("username"))
userpass = Trim(Request.QueryString("userpass"))
if username = "" Or Len(userpass) <> 16 then
ShowMsg "參數(shù)錯(cuò)誤!~請(qǐng)重新復(fù)制郵件中的網(wǎng)址到瀏覽器地址欄!~"
Call Bottom()
response.end
End if
set rs = server.CreateObject("adodb.recordset")
rs.open "select userid From JBB_user where username='"& username &"' and userpass ='"& userpass &"'",conn,1,1
if rs.eof or rs.bof then
RS.CLOSE
SET RS = NOTHING
ShowMsg "用戶名不存在或者網(wǎng)址參數(shù)錯(cuò)誤,請(qǐng)嘗試重新復(fù)制郵件中的網(wǎng)址到瀏覽器地址欄!~"
Call Bottom()
response.end
else
%>
<br>
<br>
<br>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td class="table-title"><img src="<%=BBS_Skin(3)%>JBB_bullet.gif">
重置密碼
<script language="javascript">
<!--
function isok(theform)
{
if (theform.userpass.value=="")
{
alert("請(qǐng)輸入您的新密碼!");
theform.userpass.focus();
return (false);
}
if (theform.userpass.value != theform.userpass2.value)
{
alert("您兩次輸入的密碼不一致!");
theform.userpass2.focus();
return (false);
}
return (true);
}
-->
</script></td>
</tr>
<tr>
<form name="form1" method="post" action="?action=resetok" onsubmit="return isok(this)">
<td height="35" class="table-dark">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="31%"><div align="right">請(qǐng)輸入新密碼:</div></td>
<td width="69%"><input name="userpass" type="password" id="userpass" size="16" maxlength="16">
<input name="username" type="hidden" id="username" value="<%=username%>"></td>
</tr>
<tr>
<td>
<div align="right">確認(rèn)新密碼:</div></td>
<td>
<input name="userpass2" type="password" id="userpass2" size="16" maxlength="<%=rsconfig("usernamelong")%>">
<input name="oldpass" type="hidden" id="oldpass" value="<%=userpass%>">
</td>
</tr>
<tr>
<td> </td>
<td><input name="Submit2" type="submit" id="Submit" value="提交"></td>
</tr>
</table></td>
</form>
</tr>
</table>
<br>
<br>
<br>
<%
End if
RS.CLOSE
SET RS = NOTHING
End Sub
'========================
Sub lostpass()
%>
<br>
<br>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td class="table-title"><img src="<%=BBS_Skin(3)%>JBB_bullet.gif">
找回密碼
<script language="javascript">
<!--
function isok(theform)
{
if (theform.username.value=="")
{
alert("請(qǐng)輸入用戶名!");
theform.username.focus();
return (false);
}
return (true);
}
-->
</script></td>
</tr>
<tr>
<form name="form1" method="post" action="?action=sendmail" onsubmit="return isok(this)">
<td height="35" class="table-dark">
請(qǐng)輸入你的用戶名:
<input name="username" type="text" id="username" size="16" maxlength="<%=BBS_Config(9)%>">
<input type="submit" name="Submit" value="提交"></td>
</form>
</tr>
</table>
<br>
<br>
<br>
<br>
<br>
<%
End Sub
'========================================
Call Bottom()
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -