That's correct, even though the fields are optional, when some of the
fields are populated fields all are required.

Could you explain what you mean by

"you would need some logic to decide how to build the actual filter."

Do you mean setting variables called filter below

<cfset filter = "(&(objectClass=user)">
<cfset filter = filter & "(mail=#form.mail#)"> 
<cfset filter = filter & "(sn=#form.sn#)"> 
Etc......


Then in the ldap query in the filter field just have

<cfldap action="query"
................
filter="#filter#"  
................
...............
>

????

-----Original Message-----
From: Dawson, Michael [mailto:[EMAIL PROTECTED] 
Sent: 02 February 2006 14:35
To: CF-Talk
Subject: RE: Coldfusion and Active Directory

Yes, this can be done with CF and LDAP.  It seems that, even though some
fields are optional, the fields that *are* populated are *all* required,
right?  If so, then you need an AND filter.

So that means you can simply build a dynamic filter string like this:

<cfset filter = "(&(objectClass=user)">

<cfset filter = filter & "([EMAIL PROTECTED])">

<cfset filter = filter & "(sn=MyLastName)">

<cfset filter = filter & ")">

Of course, you would need some logic to decide how to build the actual
filter.  This should work great for you.  Just watch the nesting of the
parenthesis.

M!ke 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231115
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to