📄 lostpass.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% response.Buffer = false
'****************************************************************
'* joinboard BBS Ver2.3.0/友盟论坛 Ver2.3.0
'*
'* 版权所有: 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 "参数错误!~请重新复制邮件中的网址到浏览器地址栏!~"
Call Bottom()
response.end
End if
userpass = Trim(Request.form("userpass"))
if userpass = "" then
ShowMsg "请输入您的新密码<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 "用户名不存在或者网址参数错误,请尝试重新复制邮件中的网址到浏览器地址栏!~"
Call Bottom()
response.end
else
rs("userpass") = Md5(userpass)
rs.update
End if
RS.CLOSE
SET RS = NOTHING
ShowMsg "恭喜您,您的新密码重置成功!~请点击 <a href=""login.asp"">这里</a> 使用您的新密码登录论坛!"
End Sub
'========================
Sub sendmail()
username = Trim(Request.Form("username"))
if username = "" then
ShowMsg "<font color=""#FF0000"">请输入你的用户名</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"">用户名不正确,请重新输入!~</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 "正在发送邮件,请稍候..."
mailbody = username+",您好:"+ chr(13) + chr(13) &" 欢迎您使用本论坛的密码遗忘功能,请复制下面的连接到浏览器地址栏,重新设置您的密码。" + 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服务器验证登陆名 (邮局中任何一个用户的Email地址)
msg.MailServerPassword = sendmailPass '输入smtp服务器验证密码 (用户Email帐号对应的密码)
msg.From = BBS_Config(4) '发件人Email
msg.FromName = BBS_Config(0) '发件人姓名
msg.AddRecipient useremail '收件人Email
msg.Subject = "找回您在 "& BBS_Config(0) &" 的密码" '信件主题
msg.Body = mailbody '正文
msg.Send (sendmailserver) 'smtp服务器地址(企业邮局地址)
set msg = nothing
'发信完毕
'------------------------------------------------
End if
rs.close
set rs = Nothing
response.Write("<meta HTTP-EQUIV=REFRESH CONTENT='0; URL=?action=sendok'>")
End sub
'========================
Sub sendok
ShowMsg"系统已经发一封邮件到您注册时填写的邮箱,<br>请打开邮件中的密码重设地址,重新设置您的密码。<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 "参数错误!~请重新复制邮件中的网址到浏览器地址栏!~"
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 "用户名不存在或者网址参数错误,请尝试重新复制邮件中的网址到浏览器地址栏!~"
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("请输入您的新密码!");
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">请输入新密码:</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">确认新密码:</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("请输入用户名!");
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">
请输入你的用户名:
<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()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -