Max
|
Posted: 01/14/2005, 10:16 AM |
|
Hi all,
I would like to share with you the way I've been able to authenticate std CG login page against the AD database.
Following the CCLoginUser routine
'CCLoginUser @0-18342312
Function CCLoginUser(Login, Password)
Dim Result2, Result3, Result
Dim SQL
Dim RecordSet
Dim Connection
Dim UserIDField
Dim GroupIDField
Dim OpenDS
Dim objDomain
Set Connection = New clsDBXXXXXX
Connection.Open
SQL = "SELECT [ID_Res], [Grp_Abilit] FROM [HR_Table] WHERE [Username]='" & Replace(Login, "'", "''") & "'"
Set RecordSet = Connection.Execute(SQL)
Result2 = NOT RecordSet.EOF
Set OpenDS = GetObject("GC:")
on error resume next
Set objDomain = OpenDS.OpenDSObject("GC://RootDSE", Login, Password, &h4)
If Err.Number <> 0 Then
Result3 = False
else
Result3 = True
end if
on error goto 0
Result = Result2 and Result3
If Result Then
...
CCLoginUser = Result
End Function
'End CCLoginUser
|
|
|
|