Skip to main content
March 25, 2008
Question

ldap

  • March 25, 2008
  • 1 reply
  • 352 views
I have created a function. How do i pass error param in this ldap. if my ldap return 0 record that means userid or password invalid. so when i call this function it will return error =0 or 1 and also employeeNumber,firstname,lastname,sn,cn,mail,uid,userPassword

<cfcomponent displayname="Login" hint="login ">
<cffunction name="logchk" access="remote" output="0" returntype="query" hint="user">
<cfldap name="getusers"
username="cn=Manager,dc=test,dc=test" password="test"
server="test" action="query" port="389"
attributes="employeeNumber,firstname,lastname,sn,cn,mail,uid,userPassword"
start="dc=test,dc=test" filter="employeeNumber=4444">
<cfreturn getUser />
</cffunction>
</cfcomponent>
    This topic has been closed for replies.

    1 reply

    Inspiring
    March 25, 2008
    Nick201 wrote:
    > I have created a function. How do i pass error param in this ldap.

    You have to decide how you want your code to handle this. A common
    solution is to return a structure with one key being a success|failure
    boolean or string and another key being the resulting query. Another
    one is to allow the method to throw an exception and capture this
    exception and handle it with higher level logic.

    But ultimately it is your call how you handle all the various conditions
    and states your application can be in.
    March 26, 2008
    thanks. can you provide code snippet for that . thanks