<!-- #include file="setup.asp" -->
<!-- #include file="inc/MD5.asp" -->
<%
top

select case Request("menu")

case "password"


%>



<table border=0 width=<%=dkuan%> align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25>&nbsp;<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> → 验证密码</td>
</tr>
</table>
<br>
<table width="333" border="0" cellspacing="1" cellpadding="2" align="center" class=a2>

<form action="login.asp" method="post">
<input type="hidden" value="passwordok" name="menu">
<input type="hidden" value="<%=Request("url")%>" name="url">
<tr>
<td width="328" height="25" align="center" class=a1>
登录论坛
</td></tr><tr>
<td height="19" width="328" valign="top" align="center" class=a3>
通行密码: <input type="password" size="15" name="password"><br>

<input type="submit" value=" 登录 " name="Submit1">　<input type="reset" value=" 取消 " name="Submit">
</td></tr> </form></table>

<br>
<center>
<a href=javascript:history.back()>BACK </a><br>


<%
htmlend
case "passwordok"
Response.Cookies("password")=Request("password")
response.redirect Request("url")

case "add"


url=Request("url")
username=HTMLEncode(Trim(Request("username")))
userpass=md5(Trim(Request("userpass")))

if yanzhengma>0 then
if HTMLEncode(Trim(request("addcode")))<>HTMLEncode(Trim(Session("GetCode"))) then 
error("<li>验证码错误")
End If
End If

if username=empty then error("<li>用户名没有输入")

sql="select * from [user] where username='"&username&"'"
Set Rs1=Conn.Execute(SQL)
if rs1.eof then error("<li>此用户名还未<a href=register.asp?username="&username&">注册</a>")

if Len(rs1("userpass"))<16 then
if Request("userpass")<>rs1("userpass") then error("<li>您输入的密码错误")
conn.execute("update [user] set userpass='"&userpass&"' where username='"&username&"'")

elseif Len(rs1("userpass"))=16 then
mdfive=16
if md5(Request("userpass"))<>rs1("userpass") then error("<li>您输入的密码错误")
conn.execute("update [user] set userpass='"&userpass&"' where username='"&username&"'")

else
if userpass<>rs1("userpass") then error("<li>您输入的密码错误")
end if

if rs1("membercode")=0 then error("<li>您的帐号尚未激活")
Response.Cookies("username")=username
Response.Cookies("userpass")=userpass
Response.Cookies("eremite")="0"
if Request("eremite")="1" then Response.Cookies("eremite")="1"

if Request("xuansave")=1 then
Response.Cookies("eremite").Expires=date+365
Response.Cookies("username").Expires=date+365
Response.Cookies("userpass").Expires=date+365
end if

sql="select * from [user] where username='"&Request.Cookies("username")&"'"
rs.open sql,conn
if not rs.eof then
sex=rs("sex")
myshow=rs("myshow")
end if
rs.close

if len(myshow)<40 then
	if sex="male" then 
		myshow="0>0>0>0>0>0>0>14>13>12>0>11>0>10>9>0>0>0>8>0>0>0>0>0>0"
	else
		myshow="0>0>0>0>0>0>0>7>6>5>0>4>0>3>2>0>0>0>1>0>0>0>0>0>0"
	end if
end if
response.Cookies("sex")=sex
%>
<SCRIPT>
	var myshow="<%=myshow%>"
    var Then = new Date()        
    Then.setTime(Then.getTime() + 60*1000 )   //60??
    document.cookie = "Show="+myshow
</SCRIPT>
<%

if url<>empty and instr(url,"login.asp")=0 and instr(url,"left.asp")=0 and instr(url,"error.asp")=0 then
response.redirect url
else
response.write "<SCRIPT>location='Default.asp';</SCRIPT>"
end if

case "out"
conn.execute("delete from [online] where sessionid='"&session.sessionid&"'")
Response.Cookies("username")=""
Response.Cookies("userpass")=""
succtitle="已经成功退出"
message=message&"<li><a href=Default.asp>社区首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=Default.asp>")

end select
%>
<table border=0 width=<%=dkuan%> align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25>&nbsp;<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> →  登录社区</td>
</tr>
</table><br>
<table width="333" border="0" cellspacing="1" cellpadding="2" align="center" class=a2>

<form action="login.asp" method="post">
<input type="hidden" value="add" name="menu">
<input type="hidden" value="<%=Request.ServerVariables("HTTP_REFERER")%>" name="url">
<tr>
<td width="328" height="25" align="center" class=a1>
登录社区
</td></tr><tr>
<td height="19" width="328" valign="top" align="center" class=a3>
用户名称: <input size="15" name="username" value="<%=Request.Cookies("username")%>"> <a href="register.asp">没有注册?</a><br>
用户密码: <input type="password" size="15" value name="userpass">&nbsp;
<a href="modification.asp">忘记密码?</a><br>

<%if yanzhengma>0 then%>
用户验证: <input size="15" name="addcode" value name="addcode">&nbsp; &nbsp; <%=getcode1()%><br><%end if%>

<input type="checkbox" value="1" name="xuansave" id="xuansave"><label for="xuansave">记忆</label>

<input type="checkbox" value="1" name="eremite" id="eremite"><label for="eremite">隐身</label><br>
<input type="submit" value=" 登录 " name="Submit1">　<input type="reset" value=" 取消 " name="Submit">
</td></tr> </form></table>

<br>
<center>
<a href=javascript:history.back()>BACK </a><br>


<%htmlend%>
<%
<!--------验证码插件------->
Function getcode1()
	Dim test
	On Error Resume Next
	Set test=Server.CreateObject("Adodb.Stream")
	Set test=Nothing
	If Err Then
		Dim zNum
		Randomize timer
		zNum = cint(8999*Rnd+1000)
		Session("GetCode") = zNum
		getcode1= Session("GetCode")		
	Else
		getcode1= "<img src=""nccode.asp"">"		
	End If
End Function
%>
<!--------验证码插件------->