<!--#include file="../Include/Conn.asp" -->
<!--#include file="../Include/Char.asp" -->
<!--#include file="../Include/const.asp" -->
<!--#include file="../inc/enpasswd.inc"-->
<!-- #include file="../inc/UPIConfig.asp" -->
<!--#include file="../inc/md5.asp"-->
<%'------------------------恒浪整合开始-------------------
if  Integration = True then
     dim username,password,comeurl
     Username=replace(trim(request.Form("uname")),"'","")
     Password=replace(trim(request.Form("pwd")),"'","")
	 usertype=request.Form("usertype")

     ComeUrl = replace(Lcase(Request.ServerVariables("SCRIPT_NAME")),"login.asp","")
     ComeUrl = "http://" & Lcase(Request.ServerVariables("HTTP_HOST")) & ComeUrl
     ComeUrl = ComeUrl & "index.asp"
		
    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='Usertype' value='"&usertype&"'>" & 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 if
  '------------------------恒浪整合结束-------------------
  
   uname=request("uname")
   pwd=mistake(request("pwd"))
   usertype=request("usertype")

   if usertype="person" then
   set rs=server.createobject("adodb.recordset")
   sql="select * from person where uname='"&uname&"' and pwd='"&pwd&"'"
   rs.open sql,conn,3,3
   if rs.bof or rs.eof then
   response.write"<SCRIPT language=JavaScript>alert('错误的用户名、密码或您不是此类型用户，请重新输入！');"
   response.write"javascript:history.go(-1)</SCRIPT>"
   else
   session("puid")=uname
   response.Redirect "../person/main.asp"
   end if 

   else
   
   set rs=server.createobject("adodb.recordset")
   sql="select * from company where uname='"&uname&"' and pwd='"&pwd&"'"
   rs.open sql,conn,3,3
   if rs.eof then
   response.write"<SCRIPT language=JavaScript>alert('错误的用户名、密码或您不是此类型用户，请重新输入！');"
   response.write"javascript:history.go(-1)</SCRIPT>"
   else
   session("cuid")=uname 
   response.Redirect "../company/main.asp"
   end if
   end if %>
   