Forklaring af kode
Response.Expires = -1000 'Makes the browser not cache this pageResponse.Buffer = True 'Buffers the content so our Response.Redirect will work
If Session("UserLoggedIn") = "true" Then
Response.Redirect("search.asp")
End If
Session("UserLoggedIn") = ""
Session("SUName") = ""
on error resume next
fsCompletted = Request.QueryString("f")
If fsCompletted = 1 Then
ResultHTML = ProcessForm
else
ResultHTML = ""
End If
Function ProcessForm
on error resume next
const ADS_SECURE_AUTHENTICATION=&h0001
oUsername=Request.Form("username")
oPassword=Request.Form("password")
DN="LDAP://SRV-IIS/cn=users,dc=test,dc=local"
Set MyNamespace = GetObject("LDAP:")
Set X = MyNamespace.OpenDSObject(DN, oUserName, oPassword, ADS_SECURE_AUTHENTICATION)
if err.number=0 then
Session("UserLoggedIn") = "true"
Session("SUName") = oUsername
HTML = "<p>Authenticated</p>"
Response.Redirect("search.asp")
Er der nogen der kan give mig en detaljeret forklaring af hvad der præcist sker her?