% InfoDate="2004-09-07 00:00:00" %>
<% InfoClass="燃气" %>
<% InfoLink="http://info.oil.hc360.com/html/001/001/004/107602.asp" %>
<%
MClass="AAA"
if REQUEST.ServerVariables("QUERY_STRING")<>"" then
urlstr=request.servervariables("url")&"?"&REQUEST.ServerVariables("QUERY_STRING")
else
urlstr=request.servervariables("url")
end if
if session("loginpopedom")="000000000" then
set rs=nothing
set conn=nothing
response.redirect "/include/error.asp?errorid=9"
response.end
end if
'if mid(session("filename"),3,4)<>"zcfg" and mid(session("filename"),3,4)<>"rdzz" and mid(session("filename"),3,4)<>"sycs" then
if session("loginpopedom")="" then
if session("loginuserid")<>"" and session("loginusername")<>"" then
set conn=server.createobject("adodb.connection")
conn.open oildatabase,oilusername,oilpassword
set rs=server.CreateObject("adodb.recordset")
strsql="select username,password from cor_table where providerid='" & session("loginuserid") & "'"
rs.open strsql,conn,1,1
if not rs.eof then
Username=trim(lcase(rs("username") & ""))
Password=trim(lcase(rs("password") & ""))
end if
rs.close
set rs=nothing
set conn=nothing
else
Username=trim(lcase(request.form("chem3username") & ""))
password=trim(lcase(request.form("chem3password") & ""))
end if
'====================== 从主页登陆的用户的二次信息认证
'常用参数
ipadd=Request.ServerVariables("remote_addr")
sessionid=session.SessionID
if Username="" or password="" then
%>
<%
response.end
else
username=replace(username,"'","’")
password=replace(password,"'","’")
set conn=server.createobject("adodb.connection")
conn.open oildatabase,oilusername,oilpassword
set rs=server.CreateObject("adodb.recordset")
mysql="select providerid,username,password,popedom,manageclass,startdate,enddate,lastlogintime,sessionid from cor_table where username = '" & username & "' and password='" & password &"'"
' Response.Write ""
rs.open mysql,conn,1,1
if rs.EOF and rs.BOF then '没有此会员
set rs=nothing
set conn=nothing
Response.Redirect "/include/error.asp?errorid=6"
else '22
Rem 2002。11。19 加入石油内部帐号IP限制(只供本公司IP使用)
Rem 2003。1。3 加入石油liushucai帐号控制
ipadd=Request.ServerVariables("remote_addr")
if username="liushucai" then
if ipadd<>"202.110.49.4" then
set rs=nothing
set conn=nothing
response.redirect "/include/error.asp?errorid=9"
response.end
end if
end if
providerid=rs("providerid")
'===================================================================================
'对于即将到期用户给予提示
popedom=trim(rs("popedom") & "")
enddate=rs("enddate")
if popedom<>"" and popedom<>"000000000" then
diff=datediff("d",date(),enddate)
if diff>0 and diff<=30 then
Response.Write ""
end if
if diff<=0 then
strsql="update cor_table set popedom='000000000' where providerid='" & providerid & "'"
conn.execute(strsql)
set rs=nothing
set conn=nothing
Response.Redirect "/include/error.asp?errorid=999"
end if
end if
'===================================================================================
if trim(lcase(username))="518518" then '石油网试阅用户放开 31
'oldsessionid=rs("sessionid")
popedom=rs("popedom")
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
if rs("popedom")="000000000" then
set rs=nothing
set conn=nothing
response.redirect "/include/error.asp?errorid=9"
response.end
end if
else '除了试阅帐号外的会员
'单机--------------------------------------------------------------------------------------------
MClass=trim(rs("manageclass"))
select case MClass
case "0"
if trim(rs("sessionid"))="1000000" then '51
'*********************更新COOKIES值****第一次登陆
riqi=date()&"|"&time() 'time() 'now()
sessionid=session.SessionID
ipadd=Request.ServerVariables("remote_addr")
Cookies_str=sessionid
Response.Cookies("oil98765")=cookies_str
Response.Cookies("oil98765").expires=rs("enddate")
strsql1="update cor_table set lastlogintime='"&riqi&"',sessionid='"&Cookies_str&"',ipadd='"&ipadd&"',ipaddress='"&ipadd&"' where username='"&username&"' and password='"&password&"' "
conn.Execute strsql1
'给予权限
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
'**********************
else '52
if trim(rs("sessionid"))=trim(Request.Cookies("oil98765")) then '61
'*********************更新COOKIES值***非第一次登陆
riqi=date()&"|"&time() 'time() 'now()
ipadd=Request.ServerVariables("remote_addr")
Cookies_str=sessionid
Response.Cookies("oil98765")=cookies_str
Response.Cookies("oil98765").expires=rs("enddate")
strsql1="update cor_table set lastlogintime='"&riqi&"',sessionid='"&Cookies_str&"',ipadd='"&ipadd&"',ipaddress='"&ipadd&"' where username='"&username&"' and password='"&password&"' "
'Response.Write strsql1
conn.Execute strsql1
'给予权限
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
'**********************
'Response.Write "ok"
else '如果数据库中的SISSIONID值与用户浏览器中存的COOKIES值不同则失败 62
set rs=nothing
set conn=nothing
Response.Redirect "/include/error.asp?errorid=7"
end if '60
end if
case "1" '单IP--------------------------------------------------------------------------------------------
if trim(rs("sessionid"))="1000000" then '51
'第一次登录
'*********************更新COOKIES值****第一次登陆
riqi=date()&"|"&time() 'time() 'now()
ipadd=Request.ServerVariables("remote_addr")
strsql="update cor_table set lastlogintime='"&riqi&"',sessionid='" & ipadd & "',ipadd='"&ipadd&"',ipaddress='"&ipadd&"' where username='"&username&"' and password='"&password&"' "
conn.Execute strsql
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
'**********************
else '52
if trim(rs("sessionid"))=trim(Request.ServerVariables("remote_addr")) then '61
'***********************非第一次登陆
'给予权限
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
'**********************
'Response.Write "ok"
else '如果数据库中的SISSIONID值与与用户远程主机的IP地址值不同则失败 62
set rs=nothing
set conn=nothing
Response.Redirect "/include/error.asp?errorid=7"
end if '60
end if
case "2" 'C类多IP--------------------------------------------------------------------------------------------
if trim(rs("sessionid"))="1000000" then '51
'第一次登录
'*********************更新COOKIES值****第一次登陆
riqi=date()&"|"&time() 'time() 'now()
strsql1="update cor_table set lastlogintime='"&riqi&"',sessionid='"&ipadd&"',ipadd='"&ipadd&"',ipaddress='"&ipadd&"' where username='"&username&"' and password='"&password&"' "
conn.Execute strsql1
'给予权限
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
'**********************
else '52
'提取用户远程主机的IP地址值前三段的位置
IP1=ipadd & "..."
IPary1=split(IP1,".")
IP2=rs("sessionid") & "..."
IPary2=split(IP2,".")
if IPary1(0)=IPary2(0) and IPary1(1)=IPary2(1) and IPary1(2)=IPary2(2) then
'*********************更新COOKIES值***非第一次登陆
'给予权限
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
'**********************
'Response.Write "ok"
else
set rs=nothing
set conn=nothing
Response.Redirect "/include/error.asp?errorid=7"
end if
end if '50
case "3" 'B类多IP--------------------------------------------------------------------------------------------
if trim(rs("sessionid"))="1000000" then '51
'第一次登录
'*********************更新COOKIES值****第一次登陆
riqi=date()&"|"&time() 'time() 'now()
strsql1="update cor_table set lastlogintime='"&riqi&"',sessionid='"&ipadd&"',ipadd='"&ipadd&"',ipaddress='"&ipadd&"' where username='"&username&"' and password='"&password&"' "
conn.Execute strsql1
'给予权限
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
'**********************
else '52
IP1=ipadd & "..."
IPary1=split(IP1,".")
IP2=rs("sessionid") & "..."
IPary2=split(IP2,".")
if IPary1(0)=IPary2(0) and IPary1(1)=IPary2(1) then
'*********************更新COOKIES值***非第一次登陆
'给予权限
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
'**********************
'Response.Write "ok"
else
set rs=nothing
set conn=nothing
Response.Redirect "/include/error.asp?errorid=7"
end if
end if '50
case "9"'不对用户机器做任何控制
session("loginpopedom")=rs("popedom")
session("loginusername")=rs("username")
session("loginuserid")=rs("providerid")
case else
set rs=nothing
set conn=nothing
Response.Redirect "/include/error.asp?errorid=7"
end select
end if
end if '22,rs.eof不为空的结素
rs.close
end if '250,request.form("chem3username")如果不为空,再进行用户库中的有无判断 的结素
end if 'session("loginpopedom")如果为空的结素
'end if 'zcfg,rdzz,sycs的特殊控制的结素
%>