Application("em_EnableTrap") = mam.EnableTrap
if mam.EnableTrap = true then
Application("em_TrapMail") = mam.TrapMail
end if
set mam = nothing
else
set mam = nothing
response.redirect "outerr.asp?errstr=" & Server.URLEncode("超时, 请重试") & "&" & getGRSN()
end if
end if
if un <> "" and pw <> "" and Request.ServerVariables("REQUEST_METHOD") = "POST" then
un = LCase(un)
pw = strDecode(pw, trim(request("picnum")))
if un <> Application("em_SystemAdmin") then
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 "outerr.asp?errstr=" & Server.URLEncode("拒绝IP地址 " & rip & " 访问") & "&" & getGRSN()
end if
dim tmp_un
tmp_un = ei.GetRealUser(un)
if IsNull(tmp_un) = false and Len(tmp_un) > 0 then
un = LCase(tmp_un)
end if
rip = Request.ServerVariables("REMOTE_ADDR")
if ei.CheckIPLimit(un, rip) = false then
set ei = nothing
Response.Redirect "outerr.asp?errstr=" & Server.URLEncode("拒绝IP地址 " & rip & " 访问") & "&" & getGRSN()
end if
dim checkret
checkret = ei.CheckPassWordEx(un, pw, Request.ServerVariables("REMOTE_ADDR"))
if checkret = 0 then
if un = Application("em_SystemAdmin") and ei.CheckAdminIP(Request.ServerVariables("REMOTE_ADDR")) = false then
set ei = nothing
errmsg = "管理员登录IP地址错误。"
else
Session("tid") = ei.LoginEx(un, Request.ServerVariables("REMOTE_ADDR"))
Session("wem") = un
Session("mail") = ei.GetUserMail(un)
set ei = nothing
dim mri
set mri = server.createobject("easymail.MoreRegInfo")
mri.LoadRegInfo un
mri.CurrentlyIP = Request.ServerVariables("REMOTE_ADDR")
mri.SaveRegInfo
set mri = nothing
if saveUser = "true" then
Response.Cookies("accounts") = un
Response.Cookies("accounts").Expires = DateAdd("y", 5, Now())
end if
SecEx = trim(request("SecEx"))
if SecEx = "true" then
Session("SecEx") = "1"
else
Session("SecEx") = "0"
end if
dim userweb
set userweb = server.createobject("easymail.UserWeb")
userweb.Load Session("wem")
ShowLanguage = userweb.ShowLanguage
set userweb = nothing
if ShowLanguage = 1 then
Response.Redirect "en/welcome.asp"
else
Response.Redirect "welcome.asp"
end if
end if
elseif checkret = 2 then
dim pwwt
pwwt = ei.PassWordWaitMinute
set ei = nothing
errmsg = "连续三次输入密码错误,请过" & pwwt & "分钟后再试。"
else
set ei = nothing
errmsg = "错误的用户名或密码!请再次输入。"
end if
end if
if trim(request("logout")) = "true" then
if Session("wem") <> "" then
Application("em").Logout Session("wem"), Session("tid")
end if
<SCRIPT LANGUAGE=javascript>
<!--
if (top.location !== self.location) {
top.location=self.location;
}
function window_onload() {
<%
if errmsg <> "" then
%>
alert("<%=errmsg %>");
<%
end if
if showaccounts = "" then
%>
var S = document.getElementById("usernameshow");
S.focus();
<%
else
%>
var S = document.getElementById("pwshow");
S.focus();
<%
end if
%>
}
function gook() {
var S;
<%
if showaccounts = "" then
%>
S = document.getElementById("usernameshow");
if (S.value == "")
{
alert("用户名不可为空");
S.focus();
return ;
}
<%
end if
%>
S = document.getElementById("pwshow");
if (S.value == "")
{
alert("密码不可为空");
S.focus();
return ;
}
<%
if showaccounts = "" then
%>
S = document.getElementById("usernameshow");
document.f1.username.value = S.value;
S = document.getElementById("showsaveUser");
document.f1.saveUser.value = S.checked;
<%
else
%>
document.f1.username.value = "<%=showaccounts %>";
<%
end if
%>
S = document.getElementById("showSecEx");
document.f1.SecEx.value = S.checked;
S = document.getElementById("pwshow");
document.f1.pwhidden.value = encode(S.value, parseInt(document.f1.picnum.value));
document.f1.submit();
}
function encode(datastr, bassnum) {
var tempstr;
var tchar;
var newdata = "";
for (var i = 0; i < datastr.length; i++)
{
tchar = 65535 + bassnum - datastr.charCodeAt(i);
tchar = tchar.toString();