On Thu, May 02, 2002 at 12:46:58PM +0200, Norbert Klasen wrote:
> Hi,
> does somebody have some sample code to hande a protocol mismatch? I want to
> use LDAPv3 by default and downgrade to v2 if necessary.
If your server does not support v3 then a bind for v3 should
return a code of LDAP_PROTOCOL_ERROR. So you could trap that
and then try a v2 bind instead.
$mesg = $ldap->bind(version => 3, ....);
if($mesg->code == LDAP_PROTOCOL_ERROR) {
$mesg = $ldap->bind(version => 2, ...);
}
# Process any other error code here.
Graham.
|