<!--#include file="../conn.asp"-->
<!--#include file="../Function/Function.asp"-->
<!--#include file="../function/MD5.asp" -->
<!-- #Include File = "../API/API_Config.asp"-->
<!-- #Include File = "../API/API_Function.asp"-->
<body onLoad="CheckLogin()">
<%If GetUsersSystem("UsersLoginOn")=0 Then
Response.Write("<script>alert('暂时已关闭登陆！');history.back();</script>")
response.end
End If
UserName=Request.Form("userid")
PassWord=md5(Request.Form("password"),16)

IF Cstr(Session("getcode"))<>Lcase(Cstr(Trim(Request("codestr")))) Then 
Response.Write("<script>alert('验证码有误，请重新输入！');history.back();</script>")
response.end
End IF

If API_Enable Then
	Dim iIndex,strLogoutParams
		APISysKey = LCase(MD5(UserName&API_Key,16))
		strLogoutParams = "?syskey="&APISysKey&"&username="&UserName&"&password="&PassWord&""
		For iIndex = 0 to Ubound(arrAPIUrls)
		Dim arrAPIs
		arrAPIs = Split(arrAPIUrls(iIndex),"@@")
		Response.write("<script src=""" & arrAPIs(1) & strLogoutParams &"""></script>")
		Next
End If

Call UsersLoginSever(UserName,PassWord)
Response.Cookies("YWNTUserCookie")("UserName")=UserName
Response.Cookies("YWNTUserCookie")("PassWord")=PassWord
Response.Cookies("YWNTUserCookie").Expires=Date()+1
call connclose()
%>
<script>   
  function   CheckLogin()   
  {   
                    window.opener=null;   
                    location.href = '<%=Request.ServerVariables("HTTP_REFERER")%>';   
  }   
  </script>