<%
	if issession=0 then
		if Replace_Text(Request.Cookies("username"))="" or usernames=Replace_Text(Request.Cookies("usernames"))="" or  userlist=Replace_Text(Request.Cookies("userlist"))="" then
              Response.write "<script language='javascript'>"
              Response.write"alert('对不起！请重新登陆！');parent.location.href='"&HOPE_InstallDir&"';</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 yixiang_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")=""  OR Session("adminid")="" Then
              Response.write "<script language='javascript'>"
              Response.write"alert('对不起！请重新登陆！');parent.location.href='"&HOPE_InstallDir&"';</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

%>