<%
Eshop_Lebi_name=Replace(request.cookies(cookiesname)("admin_name"),"'","")
If Eshop_Lebi_name = "" Then Eshop_Lebi_name = Session(cookiesname&"_admin"&"admin_name")
Eshop_Lebi_pass=Replace(request.cookies(cookiesname)("admin_pass"),"'","")
If Eshop_Lebi_pass = "" Then Eshop_Lebi_pass = Session(cookiesname&"_admin"&"admin_pass")
Eshop_Lebi_flag=Replace(request.cookies(cookiesname)("flag"),"'","")
If Eshop_Lebi_flag = "" Then Eshop_Lebi_flag = Session(cookiesname&"_admin"&"flag")
Eshop_Lebi_loginip=Replace(request.cookies(cookiesname)("loginip"),"'","")
If Eshop_Lebi_loginip = "" Then Eshop_Lebi_loginip = Session(cookiesname&"_admin"&"loginip")
Dim MenuType
set Rs = conn.execute("select flag,pflag,menutype from [Lebi_adminuser] where admin_name='"& Eshop_Lebi_name &"' and RndPass='"& Eshop_Lebi_pass &"'")
If rs.eof Then
        Response.redirect Eshop_url & AdminPath &"/admin_login.asp?url="& server.urlencode(GetLastUrl())
		Response.End
Else
		If CStr(rs(0)) <> CStr(Eshop_Lebi_flag) Then
				Response.redirect Eshop_url & AdminPath &"/admin_login.asp?url="& server.urlencode(GetLastUrl())
				Response.End
		End If
		response.cookies(cookiesname)("pflag")=rs(1)
		MenuType = rs(2)
End If
rs.close:Set rs=Nothing
Eshop_Lebi_pflag=Replace(request.cookies(cookiesname)("pflag"),"'","")
If Eshop_Lebi_pflag = "" Then Eshop_Lebi_pflag = Session(cookiesname&"_admin"&"pflag")
MenuType = checknum(MenuType,0)
Function GetLastUrl()
        GetLastUrl = Replace(LCase(Request.ServerVariables("URL")),Eshop_url & LCase(AdminPath) &"/","")
		If Request.ServerVariables("QUERY_STRING")<>"" Then GetLastUrl = GetLastUrl&"?"& Request.ServerVariables("QUERY_STRING")
End Function
%>
<!--#include file="config.asp"-->
<!--#include file="function.asp"-->