13th
2007,11
‘ ============================================
‘ 身份验证
‘ ============================================
Sub Sfyz()
If Session(”UserName”) = “” Or Session(”PassWord”) = “” Then
Session.Abandon()
Call Window(”index.html”,”_parent”)
Response.End()
End If
Sql = “select Username,Psw from users where Username=”"” & Session(”UserName”) & “”" and Psw=”"” & Session(”PassWord”) & “”"”
SET Rs = Server.CreateObject(”ADODB.recordset”)
Rs.Open Sql,Conn,1,1
If Rs.eof And Rs.bof Then
Session.Abandon()
Call Window(”index.html”,”_parent”)
Response.End()
Else
Closers()
End If
End Sub
‘ ============================================
‘ 权限验证
‘ ============================================
Function Yfyz(str1,str2)
If Str1 <> “” Then
If Str2 = “0″ Then
If Session(”type”) <> Str1 Then
Response.Write(”您所在用户组没有权限!”)
Response.End()
End IF
Else
If Session(”type”) = str1 or Session(”type”) = str2 Then
Exit Function
Else
Response.Write(”您所在用户组没有权限!”)
Response.End()
End if
End if
End If
End Function
//转载请注明出处 歌特中国
Name: Cngothic 































11 21st, 2007 at 3:52 am
权限验证这段子程序最多验证通过二个用户组。
一个用户组:Call Yfyz(”admin”,0)
两个用户组:Call Yfyz(”admin”,”input”)