S
sroadley
Our school is using active directory and we have groups such as
students and staff. I have produced some asp applications which I only
want staff to access. I have produced a login page which checks their
login username and password held in active directory. The problem is I
do not know how to limit access to say the teachers group. Currently
any user who enters a valid username and password is let in.
Dim strADsPath
strADsPath = "LDAP://00.0.000.00"
Administrators,OU=JPS,OU=Establishments,DC=JOHNPORT,DC=INTERNAL"
strUserName = "JOHNPORT\" & Request.Form("strUserName")
strPassword = Request.Form("strPassword")
If (not strADsPath= "") then 'if and ADS Object path has been provided
proceed with authentication
Dim oADsObject
Set oADsObject = GetObject(strADsPath)
Dim strADsNamespace
Dim oADsNamespace
strADsNamespace = left(strADsPath, instr(strADsPath, ":"))
set oADsNamespace = GetObject(strADsNamespace)
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath,
strUserName,strPassword, 0)
If not (Err.number = 0) then
msg = "<font color=darkred>Login Failed</font>"
Sesson("active") = 0
Session("user") = ""
Else
Session("active") = 1
Session("user") = Request.Form("strUserName")
Response.Redirect "index.asp"
Response.End
End If
End If
students and staff. I have produced some asp applications which I only
want staff to access. I have produced a login page which checks their
login username and password held in active directory. The problem is I
do not know how to limit access to say the teachers group. Currently
any user who enters a valid username and password is let in.
Dim strADsPath
strADsPath = "LDAP://00.0.000.00"
Administrators,OU=JPS,OU=Establishments,DC=JOHNPORT,DC=INTERNAL"
strUserName = "JOHNPORT\" & Request.Form("strUserName")
strPassword = Request.Form("strPassword")
If (not strADsPath= "") then 'if and ADS Object path has been provided
proceed with authentication
Dim oADsObject
Set oADsObject = GetObject(strADsPath)
Dim strADsNamespace
Dim oADsNamespace
strADsNamespace = left(strADsPath, instr(strADsPath, ":"))
set oADsNamespace = GetObject(strADsNamespace)
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath,
strUserName,strPassword, 0)
If not (Err.number = 0) then
msg = "<font color=darkred>Login Failed</font>"
Sesson("active") = 0
Session("user") = ""
Else
Session("active") = 1
Session("user") = Request.Form("strUserName")
Response.Redirect "index.asp"
Response.End
End If
End If