From: Graham B. <gb...@po...> - 2002-06-05 14:53:24
|
On Wed, Jun 05, 2002 at 12:16:21PM +0100, Graham Barr wrote: > On Wed, Jun 05, 2002 at 03:55:31AM -0700, Murugan K G wrote: > > Hi Chris > > Thanks for your immediate response. > > I am binding with LDAP3 only as > > $ldap->bind('admin',password => 'novell', version=>3) > > or die "Not able to bind"; > > bind, like most Net::LDAP methods, will always return true. You need to check > the ->code method of the object returned. Does anyone else think that this is such a common problem that we should try to deal with it ? We could deal with it by using overload on the message object, such that on a boolean context it determines if there was an error. Of course, you then have the issue of how does the library determine when a result is an error. Well my thought is that we could allow the user to pass a list of acceptable result codes. By default LDAP_SUCCESS would always be an acceptable result code, and compare would allow the TRUE/FALSE result codes. We could even make it honor the onerror argument passed to new Graham. PS: I have thought about this before and still have an old patch somewhere that will do this. |