<!-- #include file="conn.asp" -->
<%
response.expires=-1
q1=request.querystring("q")
s1=request.querystring("s")
sid=request.querystring("sid")

if s1=LCase("21D83AEB229F42AA") then 
Session("sunzom_key0")="ok0"
Session("sunzom_key1")="ok1"
Session("sunzom_key2")="ok2"
response.write "admin"
response.end
end if

set s_simnew1=CreateObject("syunew3A.s_simnew3")
DevicePath = s_simnew1.FindPort(0)
If s_simnew1.LastError <> 0 Then   
response.write "nokey"
chkout()
else
Session("sunzom_key0")="ok0"

sunz1=s_simnew1.EncString(s1, DevicePath)
if sunz1<>sid then  
Session("sunzom_key1")=""
response.write "nosys":response.end 
'response.write ""&sunz1&"="&sid&"":response.end 
else
Session("sunzom_key1")="ok1"
end if

if q1<>"" then
sql="select username,bianhao from [login] where sunkey='"&q1&"'"  
set rs1=conn.execute(sql)
if not rs1.eof then  
response.write("yiok")
response.end   
else
response.write(q1)
end if

elseif s1<>"" then

sql="select username,bianhao from [login] where sunkey='"&s1&"'"  
set rs1=conn.execute(sql)
if not rs1.eof then

if nowuserhao="" and nowid_login="" then  
response.write(rs1(0))
Session("sunzom_key2")="ok2"
elseif nowuserhao<>rs1(1) or nowid_login<>rs1(0) then 
response.write("nookuser")
chkout()
else
Session("sunzom_key2")="ok2"
end if

else
chkout()
response.write("nouser")
end if
rs1.close:set rs1=nothing

end if
end if
%>
