<% 
Dim LoginUrl,confimsn
set confimsn=conn.execute("select domain,Sitelock,IndexExtName,NumberContPoint,NumberLoginPoint from config")
if Request.ServerVariables("SERVER_PORT")<>"80" then
	LoginUrl = "http://"&Request.ServerVariables("LOCAL_ADDR")& ":" & Request.ServerVariables("SERVER_PORT")& Request.ServerVariables("URL")&"?"&request.QueryString
else
	LoginUrl = "http://"&Request.ServerVariables("LOCAL_ADDR")& Request.ServerVariables("URL")&"?"&request.QueryString
end if

'Dim GetDoMains,TempPaths
'if Request.ServerVariables("SERVER_PORT")<>"80" then
		'GetDoMains = Request.ServerVariables("LOCAL_ADDR")& ":" & Request.ServerVariables("SERVER_PORT")
	'else
		'GetDoMains = Request.ServerVariables("LOCAL_ADDR")
'end if
Dim UserName,UserPass,UserID,RsSessionObj,GoRefresh
UserName = Session("Name")
UserPass = Session("PassWord")
UserID = Session("AdminID")
GoRefresh=Session("UnRefreshs")
set RsSessionObj = Server.CreateObject ("ADODB.RecordSet")
RsSessionObj.Source="select * from admin where Name='"& UserName &"' and Password='"&UserPass&"'"
RsSessionObj.Open RsSessionObj.Source,Conn,1,1
if not RsSessionObj.EOF then
   if cint(RsSessionObj("Lock"))=1 then
		Response.Write("<script>alert(""错误：\n您已经被锁定,请与管理员联系!"&Copyright&""");location.href="""&GetDoMains&"/"&AdminDir&"Login.asp"";</script>")
		Response.End
   end if
   RsSessionObj.Close
   set RsSessionObj=nothing
else
   RsSessionObj.Close
   set RsSessionObj = nothing
   Response.redirect""&confimsn("domain")&"/"&AdminDir&"Login.asp?UrlAddress=" & LoginUrl
   Response.end
end if
if confimsn("Sitelock")="" then
	  Response.Write("<script>alert(""错误:\n产品信息没有找到，系统即将关闭窗口!"&Copyright&""");window.close();</script>")
      Response.End
end if
%>

