From: Chris R. <chr...@us...> - 2003-05-07 13:51:36
|
Update of /cvsroot/perl-ldap/ldap/lib/Net In directory sc8-pr-cvs1:/tmp/cvs-serv17280 Modified Files: LDAP.pm Log Message: Added supported_* methods Index: LDAP.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- LDAP.pm 6 May 2003 16:32:11 -0000 1.45 +++ LDAP.pm 7 May 2003 13:51:32 -0000 1.46 @@ -21,6 +21,7 @@ LDAP_PARAM_ERROR LDAP_INAPPROPRIATE_AUTH LDAP_SERVER_DOWN + LDAP_EXTENSION_START_TLS ); $VERSION = "0.2701"; @@ -781,6 +782,34 @@ : Net::LDAP::Schema->new($mesg->entry); } +sub supported_extension { + return _supported_feature( 'supportedExtension', @_ ); +} + +sub supported_version { + return _supported_feature( 'supportedLDAPVersion', @_ ); +} + +sub supported_control { + return _supported_feature( 'supportedControl', @_ ); +} + +sub supported_sasl_mechanism { + return _supported_feature( 'supportedSASLMechanisms', @_ ); +} + +sub _supported_feature { + my $attr = shift; + my $root = $shift->root_dse( attrs => [$attr] ) + or return undef; + my %ext; + map { $ext{$_} = 1 } $root->get_value( $attr ); + foreach (@_) { + return 0 unless exists $ext{$_}; + } + return 1; +} + sub root_dse { my $ldap = shift; my %arg = @_; @@ -820,7 +849,7 @@ $mesg->encode( extendedReq => { - requestName => "1.3.6.1.4.1.1466.20037", + requestName => LDAP_EXTENSION_START_TLS, } ); |