<!--#include file="Char.inc"-->
<%
if not(Request.cookies(echsys)("KEY")="super" or Request.cookies(echsys)("KEY")="check" or Request.cookies(echsys)("KEY")="typemaster") THEN
	Show_Err("对不起，您无权登录后台进行管理！")
	response.end
else
	if ((Request.cookies(echsys)("ManageUserName")="") or (Request.cookies(echsys)("ManagePasswd")="") or (Request.cookies(echsys)("ManageKEY")="")) then
		if IsDebug="1" then
			Show_Err("cookies(ManageUserName)(ManagePasswd)(ManageKEY)中有为空值。<br><br><a href='javascript:history.back()'>返回</a>")
		else
			response.redirect "admin_index.asp?action=Manage.asp"
		end if
		response.end
	else
		IF not(Request.cookies(echsys)("ManageKEY")="super" or Request.cookies(echsys)("ManageKEY")="check" or Request.cookies(echsys)("ManageKEY")="typemaster" or Request.cookies(echsys)("ManageKEY")="bigmaster" or Request.cookies(echsys)("ManageKEY")="smallmaster" ) THEN
			if IsDebug="1" then
					Show_Err("cookies(KEY)值不是[ManageSuper][ManageCheck][ManageTypemaster][ManageBigmaster][ManageSmallmaster]中的一个。<br><br><a href='javascript:history.back()'>返回</a>")
			else
				response.redirect "admin_index.asp?action=Manage.asp"
			end if
			response.end
		else
			UserName=CheckStr(trim(Request.cookies(echsys)("UserName")))
			M_UserName=CheckStr(trim(Request.cookies(echsys)("ManageUserName")))
			M_PassWD=trim(Request.cookies(echsys)("ManagePasswd"))
			M_Key=trim(request.cookies(echsys)("ManageKEY"))
			set urs=server.createobject("adodb.recordset")
			sql="select * from "& db_wygkcn_Manage_Table &" where ("& db_ManageUser_Name &"='"& M_UserName &"' and adder='"& UserName &"')"
			urs.open sql,Conn,1,3
			if urs.bof or urs.eof then
				if IsDebug="1" then
					Show_Err("以cookies(username)及cookies(ManageUserName)的返回值，查找不到管理用户表中的相对应记录。<br><br><a href='javascript:history.back()'>返回</a>")
				else
					response.redirect "admin_index.asp?action=Manage.asp"
				end if
				response.end
			else
				if M_PassWD<>urs(db_ManageUser_Password) then
					if IsDebug="1" then
						Show_Err("cookies(ManagePasswd)的返回值与管理用户表中的相对应记录的Password值不符。<br><br><a href='javascript:history.back()'>返回</a>")
					else
						response.redirect "admin_index.asp?action=Manage.asp"
					end if
					response.end
				else
					if M_key<>urs("OSKEY") then
						if IsDebug="1" then
							Show_Err("cookies(ManageKEY)的返回值与管理用户表中的相对应记录的OSKEY值不符。<br><br><a href='javascript:history.back()'>返回</a>")
						else
							response.redirect "admin_index.asp?action=Manage.asp"
						end if
						response.end
					end if
				end if
				urs.close
				set urs=nothing
			end if
		end if
	end if
end if%>