All the fields are optional. 

E.G. 

A user could fill in the name and e-mail fields on their first search
and just the cn name field on their next search. 

That is the functionality that needs to be in the filter, just needed to
know if this can be done with LDAP and Coldfusion ?

-----Original Message-----
From: Dawson, Michael [mailto:[EMAIL PROTECTED] 
Sent: 31 January 2006 16:45
To: CF-Talk
Subject: RE: Coldfusion and Active Directory

First, we need to know which fields are optional or required.  I don't
see anything wrong with this LDAP filter.

It says:
MUST BE
objectClass = user
AND
sAMAccountName = form.sAMAccountName
AND
cn = form.cn
AND
title = form.title
AND
email = form.email

For this filter to work, you must specify a valid value for each of
these attributes of or you will not get any results.

Are you sure you want to filter on the title?  What if someone doesn't
type the title correctly?  You may need to use a wildcard in your filter
and let them search for a partial match.

If you have optional fields, then you would need to dynamically build
your LDAP filter string and leave those fields out.

M!ke 

-----Original Message-----
From: Ian Vaughan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 31, 2006 9:48 AM
To: CF-Talk
Subject: RE: Coldfusion and Active Directory

I have a form to search the Active Diretory shown below, searching the
account name, name, title, e-mail and telephone number attributes for an
Intranet Phone Directory
 
How can I modify the filter query of the CFLDAP statement to cater for
this ?
 
filter="(&(objectClass=user)(sAMAccountName=#Form.sAMAccountName#)(cn=#F
orm.cn#)(title=#Form.title#)(email=#Form.email#))"
 
I have tried using | instead of & but that just brings back all results
??
 
 
<cfform method="POST" action="cfldap1.cfm" name="form"> 
 
<cfinput type="text" name="sAMAccountName" size=22 ><br> <cfinput
type="text" name="cn" size=22 ><br> <cfinput type="text" name="title"
size=22 ><br> <cfinput type="text" name="email" size=22 ><br> <input
type="image" src="search.gif" border="0" style="cursor:hand"
width="49" height="18">
</cfform>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230923
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