<style type="text/css">
<!--
body,td,th {
	font-size: 12px; background:#181818; margin:auto;
}
-->
</style>
<!--#include file="../Conn.asp" -->
<!--#include file="../Include/QvodCms.Md5.asp"-->
<!--#include file="../Include/QvodCms.Security.asp"-->
<!--#include file="../Include/QvodCms.Fun.asp"-->
<%
Call OpenConn()
UserName=ReplaceBadChar(NoSqlHack(Request.Form("UserName")))
PassWord=md5(ReplaceBadChar(NoSqlHack(Request.Form("PassWord"))),32)
id=Request.QueryString("id")
action=Request.QueryString("action")
if action="login" then

From_url = Cstr(Request.ServerVariables("HTTP_REFERER"))
Serv_url = Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(From_url,8,len(Serv_url)) <> Serv_url then
     response.write "非法提交数据！ "
     response.end
end If 

If Len(UserName)<5 or len(PassWord)<5 Then
Call QvodCms_Err("请输入正确的用户名和密码")
Response.End()
Else
 Set rs = Server.CreateObject("adodb.recordset")
    sql = "select * from qvodcms_user where upass='" & Password & "' and uname='" & UserName & "'"
    rs.Open sql, Conn, 1, 3
    If rs.bof And rs.EOF Then
        Call QvodCms_Err("用户名或密码错误！！！")
		Response.End()
    Else
        If Password <> rs("upass") Then
			Call QvodCms_Err("用户名或密码错误！！！")
			Response.End()
        End If
		Response.Cookies("qvodcms")("UserName") =Trim(rs("uname"))
		Response.Cookies("qvodcms")("Uid") =CInt(rs("Uid"))
        Response.Cookies("qvodcms")("Ujf") =CInt(rs("ujf"))
        Response.Cookies("qvodcms")("Ulc") =Trim(rs("ulc"))
        Response.Cookies("qvodcms")("Uvip") =rs("uvip")
		Response.Cookies("qvodcms")("UPic") =CInt(rs("upic"))
        Response.Cookies("qvodcms")("Utime") =Formatdatetime(rs("utime"),2)
        Response.Cookies("qvodcms").Expires=Date+31
		rs.Close
        'Call CloseConn
		if id="" then
		Response.Write "<script>window.parent.location.href='QvodCms_MyFav.asp';</script>"
		Else
		Response.Write "<script>window.parent.location.href='../DetailsCs.asp?name_id="&id&"';</script>"
		End if
    End If
End if
elseif action="exit" then
        Response.Cookies("qvodcms")("UserName") =""
		Response.Cookies("qvodcms")("Uid") =""
        Response.Cookies("qvodcms")("Ujf") =""
        Response.Cookies("qvodcms")("Ulc") =""
        Response.Cookies("qvodcms")("Uvip") =""
		Response.Cookies("qvodcms")("UPic") =""
        Response.Cookies("qvodcms")("Utime") =""
		Call QvodCms_Err_Url("成功退出！！！","../indexcs.html")
End if
Call CloseConn()
%>