‘ ============================================
‘ 身份验证
‘ ============================================
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

//转载请注明出处  歌特中国

, ,

Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网

1 Comment so far...

  1. cngothic

    权限验证这段子程序最多验证通过二个用户组。

    一个用户组:Call Yfyz(”admin”,0)

    两个用户组:Call Yfyz(”admin”,”input”)

Leave a reply?