📄 login.asp
字号:
<!-- #include file="Setup.asp" -->
<!-- #include file="Utility/MD5.asp" -->
<%
HtmlTop
if Request.Form("menu")="OUT" then
Conn.execute("Delete from [Wo_UserOnline] where sessionid='"&session.sessionid&"'")
CleanCookies()
session.Abandon()
succeed "已经成功退出","Default.asp"
elseif Request.ServerVariables("Request_method") = "POST" then
ReturnUrl=Request.Form("ReturnUrl")
if SiteConfig("EnableAntiSpamTextGenerateForLogin")=1 then
if Request.Form("VerifyCode")<>Session("VerifyCode") or Session("VerifyCode")="" then error("验证码错误!")
end if
UserName=HTMLEncode(Request.Form("UserName"))
UserPass=md5(Trim(Request.Form("Userpass")))
if UserName=empty then error("窝友名没有输入")
sql="select * from [Wo_Users] where UserName='"&UserName&"'"
rs.Open sql,Conn,1,3
if Rs.eof then error("此窝友名还未注册")
if Rs("UserAccountStatus")=0 then error("您的帐号正在等待审核")
if Rs("UserAccountStatus")=3 then error("您的帐号尚未通过审核")
if SiteConfig("AllowLogin")=0 and Rs("UserRoleID")<>1 then error("除管理员外任何人都不允许登录!")
if Len(Rs("Userpass"))<16 then
if Request("Userpass")<>Rs("Userpass") then error("您输入的密码错误")
Conn.execute("update [Wo_Users] set Userpass='"&Userpass&"' where UserName='"&UserName&"'")
elseif Len(Rs("Userpass"))=16 then
mdfive=16
if md5(Request("UserPass"))<>Rs("UserPass") then error("您输入的密码错误")
Conn.execute("update [Wo_Users] set Userpass='"&Userpass&"' where UserName='"&UserName&"'")
else
if UserPass<>Rs("UserPass") then error("您输入的密码错误")
end if
Rs("UserActivityTime")=""&now()&""
Rs("UserActivityIP")="'"&Request.ServerVariables("REMOTE_ADDR")&"'"
Rs.update
if Request("Invisible")="1" then
Invisible="1"
else
Invisible="0"
end if
if Request("IsSave")="1" then
Expires=9999
else
Expires=0
end if
Session("_WUserID") = Rs("UserID")
ResponseCookies "UserID",Rs("UserID"),Expires
ResponseCookies "UserPass",UserPass,Expires
ResponseCookies "Invisible",Invisible,Expires
rs.close
Session("VerifyCode")=""
if ""&ReturnUrl&""<>"" and instr(ReturnUrl,"login.asp")=0 then
response.redirect ReturnUrl
else
response.redirect ""&SiteURL&"Default.asp"
end if
end if
%>
<table width="900" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><div id="CommonBreadCrumbArea"><%ClubTree%> → 登录</div></td>
</tr>
</table>
<form action="Login.asp" method="POST" name=form>
<input type="hidden" value="<%=ReturnUrl%>" name="ReturnUrl">
<table cellspacing=1 cellpadding=0 width=900 id=CommonListArea align="center">
<tr id=CommonListTitle3>
<td align="center" colspan="2">登录</td>
</tr>
<tr id=CommonListCell height="30">
<td width="40%" align="right">窝友名称:</td>
<td>
<input type="text" name="UserName" value="<%=CookieUserName%>" style="WIDTH:150"> <a href="CreateUser.asp">没有注册?</a>
</td>
</tr>
<tr id=CommonListCell height="30">
<td width="40%" align="right">窝友密码:</td>
<td>
<input type="password" name="Userpass" style="WIDTH:150"> <a href="RecoverPassword.asp">找回密码?</a>
</td>
</tr>
<%if SiteConfig("EnableAntiSpamTextGenerateForLogin")=1 then%>
<tr id=CommonListCell>
<td width="40%" align="right" height="30">验 证 码:</td>
<td>
<input type="text" name="VerifyCode" MaxLength="4" size="10" onblur="CheckVerifyCode(this.value)" onKeyUp="if (this.value.length == 4)CheckVerifyCode(this.value)"> <img src="VerifyCode.asp" title="验证码,看不清楚?请点击刷新验证码" style="cursor:pointer" onclick="this.src='VerifyCode.asp?'+Math.random()"> <span id="CheckVerifyCode" style="color:red"></span>
</td>
</tr>
<%end if%>
<tr id=CommonListCell>
<td align="right" width="40%" height="30">登录方式:</td>
<td>
<input type="checkbox" value="1" name="IsSave" id="IsSave"><label for="IsSave">自动登录</label>
<input type="checkbox" value="1" name="Invisible" id="Invisible"><label for="Invisible">隐身登录</label>
</td>
</tr>
<tr id=CommonListCell height="30">
<td align="center" colspan="2">
<input type="submit" value=" 登录 "> <input type="reset" value=" 取消 ">
</td>
</tr>
</table>
</form>
<%
HtmlBottom
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -