<%
	Dim Angel_aspAdminID,Angel_aspAdminName,Angel_aspAdminPass,IsAdmin,rs5
	Angel_aspAdminID		=Angel_aspRequest(Request.Cookies("Angel_aspAdmin")("UserID"))
	Angel_aspAdminName	=CheckStr(Request.Cookies("Angel_aspAdmin")("UserName"))
	Angel_aspAdminPass	=CheckStr(Request.Cookies("Angel_aspAdmin")("UserPass"))

	If Angel_aspAdminID<>"" and Angel_aspAdminName<>"" and Angel_aspAdminPass<>"" then
	set rs5 = server.CreateObject ("adodb.recordset")
	sql="Select Top 1 * from ["&tbname&"_Admin] where id="& Angel_aspAdminID &" and Admin_Pass='"&Angel_aspAdminPass&"' and Admin_Name='"&Angel_aspAdminName&"'"
	on error resume next
	rs5.open sql,conn,1,1
	Dim myadminid,myadminpass,myadminuser
	myadminid	=rs5("ID")
	myadminpass	=rs5("Admin_Pass")
	myadminuser	=rs5("Admin_Name")
	myadminip	=rs5("Admin_IP")
	mymight		=rs5("AdminMight")
	myadmintype	=rs5("AdminType")
	myadpower	=rs5("ADPower")
	myWritePower =rs5("WritePower")
	myManagePower =rs5("ManagePower")
	myAdminRndPass =rs5("AdminRndPass")
	rs5.close
	set rs5=nothing
		If myadminid<>Int(Angel_aspAdminID) or myadminpass<>Angel_aspAdminPass or myadminuser<>Angel_aspAdminName or myadminip<>GetIP Then
			IsAdmin=0
		Else
			IsAdmin=1
		End If
	End If
	
	If IsAdmin<>1 then
	Response.Redirect ""&SitePath&""&SiteAdmin&"/Admin_Login.asp"
	End if
%>