Element RECORDCOUNT is undefined in USERLOOKUP
Hello!
I am trying to integrate LDAP authentication with a CF8 application. My index.cfm file posts to my ldap.cfm file, and when the username and password are entered into the form I get the error: Element RECORDCOUNT in undefined in USERLOOKUP.
Here is my ldap.cfm file (I have sanitized the server and start so I don't post any senstive infomation):
cfparam name="user_id" default="#form.username#">
<cfparam name="username" default="#form.username#">
<cfparam name="passwd" default="#form.passwd#">
<cfparam name="error" default="NO ERRORS">
<cfparam name="firstName" default="">
<cfparam name="lastName" default="">
<cfparam name="defaultErrorMsg" default="There was a problem with your username/password.">
<!--- use generic message to complicate hacking --->
<!--- query ldap to see if the user exists --->
<cftry>
<cfldap name="userLookup"
action="query"
scope="subtree"
server="ldap.edu"
port="389"
attributes="uid,dn,cn,sn"
referral="0"
filter="(&(uid=#username#))"
start="cn=group,ou=Groups,dc=edu" />
<cfcatch type="any">
<cfset error = defaultErrorMsg>
</cfcatch>
</cftry>
<!--- if a single row is returned, bind to authenticate --->
<cfif #userLookup.recordcount# EQ 1 >
<cftry>
<cfldap name="userBind"
action="query"
scope="subtree"
server="ldap.edu"
port="389"
username="#userLookup.dn#"
password="#passwd#"
attributes="dn"
filter="(objectClass=*)"
referral="0"
start="#userLookup.dn#" />
<cfcatch type="any">
<cfset error = defaultErrorMsg>
</cfcatch>
</cftry>
<cfset firstName = LEFT( Mid( userLookup.cn, 1, FindOneOf( " ", userLookup.cn ) ), 20 )>
<cfset lastName = LEFT( userLookup.sn, 30 )>
<cfelse>
<cfset error = defaultErrorMsg>
</cfif>
Can anyone help me get past this error? If more information is needed, please provide an email address that I can use to respond. Thank you for your time.
