<!--#include file="../tgzcm.Scnn.asp" -->
<%
Dim UserName,PassWord
action=Request.QueryString("action")
If action="" then
UserName=ReplaceBadChar(NoSqlHack(Request.Form("UserName")))
PassWord=md5(ReplaceBadChar(NoSqlHack(Request.Form("PassWord"))),32)
If Len(UserName)<6 or len(PassWord)<6 Then
Call tgzcm_err_c("请输入正确的用户名和密码")
Response.End()
Else
Set rs = Server.CreateObject("adodb.recordset")
    sql = "select * from tgzcm_user where upass='" & Password & "' and uname='" & UserName & "'"
    rs.Open sql, Conn, 1, 3
    If rs.bof And rs.EOF Then
        Call tgzcm_err_c("用户名或密码错误！！！")
		Response.End()
    Else
        If Password <> rs("upass") Then
			Call tgzcm_err_c("用户名或密码错误！！！")
			Response.End()
        End If
		Session("UserName")=Trim(rs("uname"))
		Session("Uid")=Clng(rs("Uid"))
		Session("Ujf")=Clng(rs("ujf"))
		Session("ulc")=Trim(rs("ulc"))
		Session("uvip")=rs("uvip")
		Session("utime")=Formatdatetime(rs("utime"),2)
		Session.TimeOut=180
		rs.Close
        Call CloseConn
		Response.Redirect "../ui/UserMian.asp"
    End If
End If
Else
        Session("UserName")=""
		Session("Uid")=""
		Session("Ujf")=""
		Session("uvip")=""
		Session("utime")=""
		Session("ulc")=""
        session.Abandon
		Call CloseConn
	    Call tgzcm_err_b("成功安全退出！！！","../index.asp")
End If
%>
