From: Jonathan L. <jon...@le...> - 2000-07-27 11:06:59
|
I would really like to write/help write a FAQ, any body up for it? It isn't very hard to accomplish this, I write wrapper function for all the things I am doing on the LDAP directory. I have functions like ldap_search, ldap_modify,ldap_exists . The first argument they all take it the Net::LDAP connection object. Sample code: sub ldap_connect{ my $ldap = Net::LDAP->new($LDAP_HOST) or die $!; $ldap->bind($LDAP_BINDDN, password => $LDAP_PASS); return $ldap; } sub ldap_disconnect{ my $ldap = shift; $ldap->unbind; } sub ldap_modify{ my ($ldap,$dn,$mods ) = @_ ; my $result = $ldap->modify($dn, replace => { %$mods }); return $result; } If I had problem with timeouts, you would just have to come up with a heuristic of checking if the server is alive ( I dont' think anything like $ldap->ping exists, THAT would be cool ) and then do a check at the beginning of every function. David Bussenschutt (d.b...@ma...) was saying: > There seem to have been a few people interested in either reconnecting on > time-outs, or getting past search-limits...both of which are optionally > imposed by the server. > Since it's clear that Graham et al think it shouldn't be part of the > library, rather a function of the application, does anyone who's done this > sort of thing have sample code that they'd like to share...perhaps it could > be added to the as-yet-nonexistant-but-hopefully-soon-going-to-be FAQ.?? > > David. > -- Jonathan Leto T3 Link Inc. www.t3link.com |