  <%
 if issession=0 then
 if Request.Cookies("username")="" or   Request.Cookies("usernames")="" or  Request.Cookies("userlist")="" or  Request.Cookies("userlists")="" then
	response.write "<script language='javascript'>"
	response.write"parent.location.href='../login.asp';</SCRIPT>" 
	response.end 
 end if
 
 '--------------------
   username=Request.Cookies("username")
   userlist=Request.Cookies("userlist")
   userlists=Request.Cookies("userlists")
   usernames=Request.Cookies("usernames")
 dim boolloginu
    boolloginu=false
 if usernames<>"" then
   set rscooku=server.CreateObject("adodb.recordset")
  sqlcooku="select UserName,PassWord,Flag,LastLoginIp from Websen_worldec_master where id="&usernames
    rscooku.open sqlcooku,conn,1,1
   if not rscooku.eof then
     if rscooku("UserName")=username and rscooku("PassWord")=userlist      then
     boolloginu=true
	else
	 boolloginu=false
    end if

  	if numid<>"no" then	
  	if boolloginu=true then
 	'权限限制^^^^^^^^^^^^^^^^^^^^
	 dim ishavegantu
	 ishavegantu=false
	 in_str=split(rscooku("Flag"),",")
	 for each ins in in_str
	 if trim(ins)=numid  then 
	 ishavegantu=true
	 end if
	 next 
	 if ishavegantu=false then
	 if dir<>"no" then 
	 response.redirect dir
	 response.end
	 end if
	 end if
  	end if
	end if

    set rscooku=nothing
   end if

   end if

 '-------------------
else
    if session("globalecmaster")="" and  session("masterflag")="" then
	response.write "<script language='javascript'>"
	response.write"parent.location.href='../login.asp';</SCRIPT>" 
	response.end
   end if
 if   session("masterflag")<>"" then 
   '权限验证--------------------------------------------
  if numid<>"no" then 
  	'权限限制^^^^^^^^^^^^^^^^^^^^
	 dim ishavegantadmin
	 ishavegantadmin=false
	 in_str=split(session("masterflag"),",")
	 for each ins in in_str 
	 if trim(ins)=numid  then 
	 ishavegantadmin=true 
	 end if
	 next 
	 if ishavegantadmin=false then 
	 if dir<>"no" then 
	 response.redirect dir
	 response.end
	 end if
	 end if
  end if
   '--------------------------------------------------
 end if
   
end if  
%>