<!--#INCLUDE FILE="setup.asp" -->
<!--#include file="checkuser.asp"-->
<!--#include file="theme.asp"-->
<!--#include file="include/encrypt.asp"-->
<!-- #include file="inc/UPIConfig.asp" -->
<%
Dim Locat,Act
Locat="同学录登陆"

Dim RemoveUser
if Request("action")="logout" Then

Dim ComeUrl
ComeUrl = Request.ServerVariables("HTTP_REFERER")
If Lcase(Left(ComeUrl,4)) <> "http" Then 
	ComeUrl = Replace(Lcase(Request.ServerVariables("SCRIPT_NAME")),"logout.asp","")
	If Request.ServerVariables("SERVER_PORT") <> "80" Then
		ComeUrl = "http://" & LCase(Request.ServerVariables("SERVER_NAME")) & ":" & Request.ServerVariables("SERVER_PORT") & ComeUrl
	Else
		ComeUrl = "http://" & LCase(Request.ServerVariables("SERVER_NAME")) & ComeUrl
	End If
	ComeUrl = ComeUrl & Dvbbs.Forum_Info(11)
End If
Response.Redirect HL_Url&Manage_Url&"User_Logout.asp"

ElseIf Request("action")="CheckLogin" Then
	%>
	<!--#include file="include/validate.asp"-->
	<%
	Call chklogin()
Else
    if session("fytxl")<>"" then
	response.redirect"Default.asp"
	else
	Call top(1,1)
	Call loginform()
	end if
End if

Sub loginform()
%>

<br><BR><form action="Login.asp" method="post"> 
<input type=hidden name=action value=CheckLogin>
<table cellpadding=0 cellspacing=0 border=0 width=700 Class=TableBorder align=center>
    <tr>    
        <td>
        <table cellpadding=5 cellspacing=1 border=0 width=100%>
    <tr >
    <th colspan=2 align=center>
    <b>同学录登陆</b></th></tr>
    <tr Class=LightTableBody>
    <td>&nbsp;&nbsp;请输入您的用户名</td>
    <td><INPUT name=fyuser type=text value="<%if Request("name")<>"" Then Response.Write  Request("name") Else 'Response.Write htmlencode(Request.cookies("txl")("username"))%>" maxlength=12> &nbsp; <a href="Register.asp">没有注册？</a></td></tr>
    <tr Class=LightTableBody>
    <td>&nbsp;&nbsp;请输入您的密码</td>
    <td><INPUT name=fypwd type=password maxlength=12> &nbsp; <a href="GetPasswd.asp" style="cursor:help">忘记密码？</a></td></tr>
	<input type=hidden name=comeurl value="<%=Request.ServerVariables("HTTP_REFERER")%>">
    <tr Class=DarkTableBody>
    <td colspan=2 align=center><input type=submit name="submit" value="登陆(L)" accesskey="l" class=button style="width:70px"></td></tr></table></td></tr></table>
</form>

<%End Sub


Sub chklogin()

dim username,password,comeurl
Username=replace(trim(Request.form("fyuser")),"'","")
Password=replace(trim(Request.form("fypwd")),"'","")
if Username="" or Password="" then
response.Redirect"Default.asp"
response.End()
end if

If ComeUrl <> "" Then
		ComeUrl = Replace(Lcase(Request.ServerVariables("SCRIPT_NAME")),"Login_Check.asp",ComeUrl)
		ComeUrl = "http://" & Lcase(Request.ServerVariables("HTTP_HOST")) & ComeUrl
	Else
		ComeUrl = Replace(Lcase(Request.ServerVariables("SCRIPT_NAME")),"Login_Check.asp","")
		ComeUrl = "http://" & Lcase(Request.ServerVariables("HTTP_HOST")) & ComeUrl
		
	End If
Response.Write "<form name='upiform' id='upiform' action='"&HL_Url&Manage_Url&"User_ChkLogin.asp' method='post'>" & vbCrLf
	Response.Write "	<input type='hidden' name='UserName' value='"&Username&"'>" & vbCrLf
	Response.Write "	<input type='hidden' name='UserPassword' value='"&Password&"'>" & vbCrLf
	
	Response.Write "	<input type='hidden' name='ComeUrl' value='"&ComeUrl&"'>" & vbCrLf
	Response.Write "</form>" & vbCrLf
	Response.Write "<script language='JavaScript' type='text/javascript'>" & vbCrLf
	Response.Write "<!--//Powered by PowerEasy Inc." & vbCrLf
	Response.Write "	upiform.submit();" & vbCrLf
	Response.Write "//-->" & vbCrLf
	Response.Write "</script>" & vbCrLf
End Sub


Call footer()
%>
