Added Net::LDAP to the distribution for easier installs.
This commit is contained in:
parent
f51b335d74
commit
223c014813
47 changed files with 15060 additions and 2 deletions
72
lib/Net/LDAP/DSML/Parser.pm
Normal file
72
lib/Net/LDAP/DSML/Parser.pm
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
package Net::LDAP::DSML::Parser;
|
||||
|
||||
use Net::LDAP::Entry;
|
||||
#use Net::LDAP::Schema;
|
||||
use vars qw($VERSION);
|
||||
|
||||
$VERSION = "0.06";
|
||||
|
||||
|
||||
# dsml:entry
|
||||
|
||||
*{'dsml:entry'} = sub {
|
||||
my ($self,$tag, %attr) = @_;
|
||||
my $entry = $self->{net_ldap_entry} = Net::LDAP::Entry->new;
|
||||
$entry->dn( $attr{dn} );
|
||||
};
|
||||
|
||||
*{'dsml:entry_'} = sub {
|
||||
my $self = shift;
|
||||
if ($self->{net_ldap_entry_handler}) {
|
||||
&{$self->{net_ldap_entry_handler}}(delete $self->{net_ldap_entry});
|
||||
}
|
||||
};
|
||||
|
||||
# dsml:attr
|
||||
|
||||
*{'dsml:attr'} = sub {
|
||||
my ($self,$tag, %attr) = @_;
|
||||
$self->{net_ldap_attr} = $attr{name};
|
||||
};
|
||||
|
||||
*{'dsml:attr_'} = sub {
|
||||
my $self = shift;
|
||||
delete $self->{net_ldap_attr};
|
||||
};
|
||||
|
||||
|
||||
# dsml:value
|
||||
|
||||
*{'dsml:value'} = sub {
|
||||
my ($self,$tag, %attr) = @_;
|
||||
$self->{net_ldap_base64} =
|
||||
(exists $attr{encoding} && lc($attr{encoding}) eq 'base64')
|
||||
and require MIME::Base64;
|
||||
};
|
||||
|
||||
*{'dsml:value_'} = sub {
|
||||
my $self = shift;
|
||||
delete $self->{net_ldap_base64};
|
||||
};
|
||||
|
||||
|
||||
|
||||
*{'dsml:oc-value'} = \&{'dsml:value'};
|
||||
*{'dsml:oc-value_'} = \&{'dsml:value_'};
|
||||
|
||||
*{'dsml:objectclass'} = sub {};
|
||||
*{'dsml:objectclass_'} = sub {};
|
||||
|
||||
*{'dsml:dsml'} = sub {};
|
||||
*{'dsml:dsml_'} = sub {};
|
||||
|
||||
*{'dsml:directory-entries'} = sub {};
|
||||
*{'dsml:directory-entries_'} = sub {};
|
||||
|
||||
sub AUTOLOAD {
|
||||
my $tag = substr($AUTOLOAD,25);
|
||||
die "Unknown tag '$tag'";
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue