📄 default.asp
字号:
<%
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>
<%
un = trim(request("username"))
pw = trim(request("pwhidden"))
saveUser = trim(request("saveUser"))
cleancookies = trim(request("cleancookies"))
if cleancookies = "true" then
Response.Cookies("accounts") = ""
end if
showaccounts = trim(request.Cookies("accounts"))
Response.Cookies("name") = ""
dim ei
dim errmsg
errmsg = trim(request("errstr"))
if IsEmpty(Application("em_MaxFolders")) and IsEmpty(Application("em_MaxMPOP3")) and IsEmpty(Application("em_MaxSigns")) then
TimeDelaySeconds(5)
dim mam
set mam = server.createobject("easymail.AdminManager")
mam.Load
if mam.IsLoadOK = true then
Application("em_MaxFolders") = mam.MaxFolders
Application("em_MaxMPOP3") = mam.MaxMPOP3
Application("em_MaxSigns") = mam.MaxSigns
Application("em_SystemAdmin") = mam.SystemAdmin
Application("em_EnableBBS") = mam.EnableBBS
Application("em_Enable_SignHold") = mam.Enable_SignHold
Application("em_Enable_FreeSign") = mam.Enable_FreeSign
Application("em_Enable_SignWithDomainUser") = mam.Enable_SignWithDomainUser
Application("em_Enable_SignNumberLimit") = mam.Enable_SignNumberLimit
Application("em_SignNumberLimitDays") = mam.SignNumberLimitDays
Application("em_Enable_ShareFolder") = mam.Enable_ShareFolder
Application("em_Enable_SignEnglishName") = mam.Enable_SignEnglishName
Application("em_LogPageKSize") = mam.LogPageKSize
Application("em_TestAccounts") = mam.TestAccounts
Application("em_SignMode") = mam.SignMode
Application("em_SignWaitDays") = mam.SignWaitDays
Application("em_am_Name") = mam.am_Name
Application("em_am_Accounts") = mam.am_Accounts
set mam = nothing
else
set mam = nothing
response.redirect "err.asp?errstr=" & Server.URLEncode("Error: WebEasyMail service may not have started") & "&" & 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 "err.asp?errstr=" & Server.URLEncode("Access from IP address " & rip & " denied") & "&" & getGRSN()
end if
set webkill = nothing
end if
set ei = Application("em")
Session("wem") = ""
Session("mail") = ""
Session("tid") = ""
Session("SecEx") = ""
dim pwwt
pwwt = ei.PassWordWaitMinute
dim checkret
checkret = ei.CheckPassWordEx(un, pw, Request.ServerVariables("REMOTE_ADDR"))
if checkret = 0 then
Session("tid") = ei.Login(un)
Session("wem") = un
Session("mail") = ei.GetUserMail(un)
set ei = 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 = 0 then
Response.Redirect "../welcome.asp"
else
Response.Redirect "../welcome.asp"
end if
elseif checkret = 2 then
set ei = nothing
errmsg = "Your account has been locked for " & pwwt & " minute(s) because of 3 unsuccessful login attempts."
else
set ei = nothing
errmsg = "Invalid password, please try again."
end if
end if
if Session("wem") <> "" then
set ei = Application("em")
ei.Logout Session("wem"), Session("tid")
set ei = nothing
end if
Session("wem") = ""
Session("mail") = ""
Session("tid") = ""
Session("SecEx") = ""
%>
<html>
<head>
<TITLE>Corp.Email</TITLE>
<LINK href="..\images\admin\wei.css" rel=stylesheet>
<SCRIPT LANGUAGE=javascript>
<!--
if (top.location !== self.location) {
top.location=self.location;
}
function window_onload() {
<%
if showaccounts = "" then
%>
usernameshow.focus();
<%
else
%>
pwshow.focus();
<%
end if
if errmsg <> "" then
%>
alert("<%=errmsg %>");
<%
end if
%>
}
function gook() {
<%
if showaccounts = "" then
%>
if (usernameshow.value == "")
{
alert("User ID cannot be empty.");
usernameshow.focus();
return ;
}
<%
end if
%>
if (pwshow.value == "")
{
alert("Password cannot be empty.");
pwshow.focus();
return ;
}
<%
if showaccounts = "" then
%>
f1.saveUser.value = showsaveUser.checked;
f1.username.value = usernameshow.value;
<%
else
%>
f1.username.value = "<%=showaccounts %>";
<%
end if
%>
f1.SecEx.value = showSecEx.checked;
f1.pwhidden.value = encode(pwshow.value, parseInt(f1.picnum.value));
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();
while(tchar.length < 5)
{
tchar = "0" + tchar;
}
newdata = newdata + tchar;
}
return newdata;
}
//-->
</SCRIPT>
</head>
<body LANGUAGE=javascript onload="return window_onload()">
<br><br>
<form name="f1" method="post" action="default.asp">
<input type="hidden" name="username">
<input type="hidden" name="pwhidden">
<input type="hidden" name="picnum" value="<%=createRnd() %>">
<input type="hidden" name="saveUser">
<input type="hidden" name="SecEx">
</form>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="477" align="center">
<tr>
<td><img src="../images/admin/spacer.gif" width="26" height="1" border="0"></td>
<td><img src="../images/admin/spacer.gif" width="211" height="1" border="0"></td>
<td><img src="../images/admin/spacer.gif" width="210" height="1" border="0"></td>
<td><img src="../images/admin/spacer.gif" width="30" height="1" border="0"></td>
<td><img src="../images/admin/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td colspan="4"><img name="../images/admin/login_r1_c1" src="../images/admin/login_r1_c1.jpg" width="477" height="65" border="0"></td>
<td><img src="../images/admin/spacer.gif" width="1" height="65" border="0"></td>
</tr>
<tr>
<td colspan="2"><img name="../images/admin/login_r2_c1" src="../images/admin/login_r2_c1.jpg" width="237" height="177" border="0"></td>
<td colspan="2"><img name="login_r2_c3" src="../images/admin/login_r2_c3.jpg" width="240" height="177" border="0"></td>
<td><img src="../images/admin/spacer.gif" width="1" height="177" border="0"></td>
</tr>
<tr>
<td rowspan="2"><img name="login_r3_c1" src="../images/admin/login_r3_c1.jpg" width="26" height="96" border="0"></td>
<td colspan="2" bgcolor="#F4F9FD" valign="middle">
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center" class="d">
<tr bgcolor="#F1F9FE">
<td width="37%" height="30">
<div align="right">用户名:</div>
</td>
<td width="42%" height="30">
<input type="text" name="usernameshow" class="kuang" value="">
</td>
<td rowspan="2" height="56" width="21%">
<input type="image" border="0" name="imageField3" src="../images/admin/login.jpg" width="73" height="17" onClick="javascript:gook()">
<input type="hidden" name="showSecEx">
<input type="hidden" name="showsaveUser">
</td>
</tr>
<tr bgcolor="#F1F9FE">
<td width="37%" height="30">
<div align="right">
<p>密 码:
</div>
</td>
<td width="42%" height="30">
<input type="password" name="pwshow" class="kuang">
</td>
</tr>
</table>
</td>
<td rowspan="2"><img name="login_r3_c4" src="../images/admin/login_r3_c4.jpg" width="30" height="96" border="0"></td>
<td><img src="../images/admin/spacer.gif" width="1" height="91" border="0"></td>
</tr>
<tr>
<td colspan="2"><img name="login_r4_c2" src="../images/admin/login_r4_c2.jpg" width="421" height="5" border="0"></td>
<td><img src="../images/admin/spacer.gif" width="1" height="5" border="0"></td>
</tr>
</table>
</div>
</body>
</html>
<%
function getGRSN()
dim theGRSN
Randomize
theGRSN = Int((9999999 * Rnd) + 1)
getGRSN = "GRSN=" & CStr(theGRSN)
end function
function createRnd()
dim retval
retval = getGRSN()
if Len(retval) > 4 then
retval = Right(retval, 4)
end if
if Left(retval, 1) = "0" then
retval = "5" & Right(retval, 3)
end if
createRnd = retval
end function
function strDecode(sd_Data, sd_bassnum)
dim sd_vChar
dim sd_NewData
dim sd_TempChar
sd_vChar = 1
do
if sd_vChar > Len(sd_Data) then
exit do
end if
sd_TempChar = CLng(Mid(sd_Data, sd_vChar, 5))
sd_TempChar = ChrW(65535 + sd_bassnum - sd_TempChar)
sd_NewData = sd_NewData & sd_TempChar
sd_vChar = sd_vChar + 5
loop
strDecode = sd_NewData
end function
function TimeDelaySeconds(DelaySeconds)
SecCount = 0
Sec2 = 0
while SecCount < DelaySeconds + 1
Sec1 = Second(Time())
if Sec1 <> Sec2 then
Sec2 = Second(Time())
SecCount = SecCount + 1
end if
wend
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -