?? login.asp
字號(hào):
<!--#include file="../Include/AdoConn.asp"-->
<%
dim UserCode,Password,SubmitType
UserCode=trim(Request("Usercode"))
Password=trim(Request("Password"))
SubmitType=trim(Request("SubmitType"))
dim objres,strsql
if submitType="expert" then response.end
set objres=server.CreateObject ("ADODB.recordset")
strsql="select 用戶(hù)編碼,密碼,有效標(biāo)志,用戶(hù)姓名,部門(mén)編碼 from XT_VC_User where 用戶(hù)編碼='"+Usercode+"'"
objres.Open strsql,strconn
if objres.EOF then
Response.Redirect "../index.asp?info=無(wú)此用戶(hù),請(qǐng)注冊(cè)!"
else
if not trim(objres("密碼"))=trim(password) then
Response.Redirect "../index.asp?info=您的密碼錯(cuò)誤,請(qǐng)重新登錄!"
else
if not trim(objres("有效標(biāo)志"))="1" then
Response.Redirect "../index.asp?info=請(qǐng)等待主管部門(mén)批準(zhǔn)!"
else
session("usercode")=objres("用戶(hù)編碼")
session("username")=objres("用戶(hù)姓名")
session("departcode")=objres("部門(mén)編碼")
''''''''''''''''''''''''''''''讀取用戶(hù)角色,并賦給全局變量
set objres2=server.CreateObject ("adodb.recordset")
objres2.CursorType =3
objres2.CursorLocation =3
objres2.LockType =2
strsql="select * from xt_vp_UserRole where 用戶(hù)編碼='"+usercode+"'"
objres2.Open strsql,strconn
if objres2.RecordCount>0 then
redim SessionRole(objres2.RecordCount)
for i=0 to objres2.RecordCount-1
SessionRole(i)=objres2("角色名稱(chēng)")
objres2.MoveNext
next
objres.Close
set objres=nothing
session("rolebiaoshi")="Y"
session("role")=SessionRole
objres2.Close
set objres2=nothing
end if
'''''''''''''''''''''''''''''''判斷用戶(hù)IP是否有權(quán)限
' IP=Request.ServerVariables("remote_addr")
' session("IPno")=""
' dim objres1,strsql1,begin1,end1'判斷IP是否有效
' set objres1=server.CreateObject("ADODB.recordset")
' strsql1="select * from XT_TC_UserIP"
' objres1.Open strsql1,conn
' begin1=objres1("IP首地址")
' end1=objres1("IP末地址")
'
' UIP=split(IP,".")
' BIP=split(begin1,".")
' EIP=split(end1,".")
'
' '判斷第四位是否相同
' if not (cint(UIP(3))>cint(BIP(3))and cint(UIP(3))<(EIP(3))) then'判斷第四位是否在首地址及末地址中
' session("IPno")="no"
' else
' for i=0 to 2'判斷用戶(hù)IP前三位與數(shù)據(jù)庫(kù)首IP前三位是否相同,如果不相同,顯示無(wú)權(quán)限
' if UIP(i)<>BIP(i) then
' session("IPno")="no"
' end if
' next
' end if
' if session("UserCode")="002001" then session("IPno")=""
' '''''''''''''''''''''''''''''''''''''''''''''''IP判斷結(jié)束
'''''''''''''將用戶(hù)寫(xiě)入“在線(xiàn)用戶(hù)”數(shù)據(jù)表
Response.Redirect "../system.asp"
end if
end if
end if
%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -