Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
XP is just a number
 
PerlMonks  

Re: How do you check a 'bind' in LDAP?

by hgolden (Pilgrim)
on Sep 18, 2006 at 08:36 UTC ( [id://573536]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to How do you check a 'bind' in LDAP?

Hey

The object will hold the error code if there is one, so you can check it. Here's an excerpt from the FAQ: http://ldap.perl.org/FAQ.html

"Most methods in Net::LDAP return a Net::LDAP::Message object, or a sub-class of that. This object will hold the results from the server, including the result code. So, for example, to determine the result of the bind operation.

$mesg = $ldap->bind( $dn, password => $passwd ); if ( $mesg->code ) { # Handle error codes here }
"

Hope this helps,

Hays

Replies are listed 'Best First'.
Re^2: How do you check a 'bind' in LDAP?
by LittleGreyCat (Scribe) on Sep 18, 2006 at 09:09 UTC
    Hays,

    Many thanks - I was just coming back to update my question with a "found it" because another bit I was reading just sank in.

    My code now has:

    $result->code && die "\nSomething bad happened : ", $result->error ;

    This works fine; I now feel dumb for not spotting it sooner.

    Cheers

    Dave R

    Nothing succeeds like a budgie with no teeth.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://573536]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.