📄 forget.asp
字号:
<%
Response.CacheControl = "no-cache"
mode = trim(request("mode"))
if mode <> "sub" then
server_v1=CStr(Request.ServerVariables("HTTP_REFERER"))
server_v2=CStr(Request.ServerVariables("SERVER_NAME"))
if Mid(server_v1, 8, Len(server_v2)) <> server_v2 then
Response.Redirect "forgetbf.asp?errstr=" & Server.URLEncode("URL Error") & "&" & getGRSN()
end if
end if
dim webkill
set webkill = server.createobject("easymail.WebKill")
webkill.Load
rip = Request.ServerVariables("REMOTE_ADDR")
if webkill.IsKill(rip) = true then
set webkill = nothing
response.redirect "err.asp?gourl=default.asp&errstr=" & Server.URLEncode("Access from IP address " & rip & " denied") & "&" & getGRSN()
end if
set webkill = nothing
%>
<%
un = trim(request("username"))
dim errmsg
if Request.ServerVariables("REQUEST_METHOD") <> "POST" then
response.redirect "forgetbf.asp?errstr=" & Server.URLEncode("Operation Failed") & "&" & getGRSN()
end if
if un = "" then
response.redirect "forgetbf.asp?errstr=" & Server.URLEncode("User ID cannot be empty") & "&" & getGRSN()
end if
dim ei
set ei = server.createobject("easymail.UserWeb")
'-----------------------------------------
ei.Load un
if ei.QuestionInfo = "" or ei.AnswerInfo = "" then
set ei = nothing
response.redirect "forgetbf.asp?errstr=" & Server.URLEncode("No such user or the user has not set account protection.") & "&" & getGRSN()
end if
if mode = "sub" then
AnswerInfo = trim(request("AnswerInfo"))
AnswerInfo = replace(AnswerInfo, """", "'")
tempai = ei.AnswerInfo
set ei = nothing
if AnswerInfo = tempai then
set euser = Application("em")
euser.GetUserByName2 un, outname, outdomain, outcomment, outforbid, outlasttime, outaccessmode
if outforbid = false then
outname = NULL
outdomain = NULL
outcomment = NULL
outforbid = NULL
outlasttime = NULL
outaccessmode = NULL
Session("tid") = euser.Login(un)
Session("wem") = un
Session("mail") = euser.GetUserMail(un)
set euser = nothing
Response.Redirect "welcome.asp?noticemsg=" & Server.URLEncode("Please change your password in time") & "&" & getGRSN()
else
outname = NULL
outdomain = NULL
outcomment = NULL
outforbid = NULL
outlasttime = NULL
outaccessmode = NULL
set euser = nothing
response.redirect "default.asp?errstr=" & Server.URLEncode("This account is forbidden.") & "&" & getGRSN()
end if
end if
response.redirect "forgetbf.asp?errstr=" & Server.URLEncode("Verification failed.") & "&" & getGRSN()
end if
%>
<HTML>
<HEAD>
<title>Corp.Email</title>
<LINK href="images\hwem.css" rel=stylesheet>
</HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function window_onload() {
showAnswerInfo.focus();
}
function gosub() {
if (showAnswerInfo.value == "")
{
alert("Please enter \"the answer for account protection question\".");
showAnswerInfo.focus();
return ;
}
fm1.AnswerInfo.value = showAnswerInfo.value;
fm1.submit();
}
//-->
</SCRIPT>
<body LANGUAGE=javascript onload="return window_onload()">
<br><br><br><br>
<form method="post" action="forget.asp" name="fm1">
<input type="hidden" name="username" value="<%=un %>">
<input type="hidden" name="mode" value="sub">
<input type="hidden" name="AnswerInfo">
</Form>
<table width="500" border="0" align="center" cellspacing="0" bgcolor="#EFF7FF" height="220">
<tr bgcolor="#dbeaf5">
<td height="28" align="center" nowrap height="28" style="border-left:1px #8CA5B5 solid; border-top:1px #8CA5B5 solid; border-right:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><font class="s" color="#104A7B"><b>Forgot Password</b></font></td>
</tr>
<tr align="center">
<td><br>
<div align="center">
<table width="90%" border="0">
<tr>
<td width="65%" height="40">
<font class="s" color="#104A7B"><b>Account protection question:</b></font>
</td>
<td><font color="#FF3333"><b><%=ei.QuestionInfo %></b></font></td>
</tr>
<tr><td height="20"><font class="s" color="#104A7B"><b>Hint for account protection question:</b></font></td>
<td><font color="#FF3333"><b><%=ei.HintInfo %></b></font></td>
</tr>
<tr>
<td height="60"><font class="s" color="#104A7B"><b>Answer for account protection question:</b></font></td><td><input type="text" name="showAnswerInfo" class='textbox' maxlength="256">
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td height="40" bgcolor="#ffffff" align="right"><br><br>
<input type="button" value="Submit" onclick="javascript:gosub()" class="Bsbttn">
<input type="button" value="Cancel" onclick="javascript:location.href='viewmailbox.asp?<%=getGRSN() %>';" class="Bsbttn">
</td>
</tr>
</table>
<br>
</BODY>
</HTML>
<%
set ei = nothing
function getGRSN()
dim theGRSN
Randomize
theGRSN = Int((9999999 * Rnd) + 1)
getGRSN = "GRSN=" & CStr(theGRSN)
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -