line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2008 Peter Marschall . All rights reserved. |
2
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or |
3
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Net::LDAP::Control::PreRead; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1665
|
use Net::LDAP::Control; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
127
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Net::LDAP::Control); |
10
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
18
|
use Net::LDAP::ASN qw(AttributeSelection SearchResultEntry); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
14
|
|
13
|
2
|
|
|
2
|
|
994
|
use Net::LDAP::Entry; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
65
|
|
14
|
2
|
|
|
2
|
|
25
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
614
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# use some kind of hack here: |
17
|
|
|
|
|
|
|
# - calling the control without args means: response, |
18
|
|
|
|
|
|
|
# - giving an argument: means: request |
19
|
|
|
|
|
|
|
sub init { |
20
|
0
|
|
|
0
|
1
|
|
my($self) = @_; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
delete $self->{asn}; |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
unless (exists $self->{value}) { |
25
|
0
|
|
0
|
|
|
|
$self->{asn} = $self->{attrs} || []; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
$self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub attrs { |
32
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
0
|
|
|
|
$self->{asn} ||= $AttributeSelection->decode($self->{value}); |
35
|
0
|
0
|
|
|
|
|
if (@_) { |
36
|
0
|
|
|
|
|
|
delete $self->{value}; |
37
|
0
|
|
|
|
|
|
return $self->{asn} = [ @_ ]; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
$self->{asn}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub entry { |
44
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
45
|
0
|
|
|
|
|
|
my %opt = @_; |
46
|
0
|
|
|
|
|
|
my $entry; |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if ($self->{value}) { |
49
|
0
|
|
|
|
|
|
my $data = $SearchResultEntry->decode($self->{value}); |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$entry = Net::LDAP::Entry->new; |
52
|
0
|
|
0
|
|
|
|
$entry->decode($data, raw => $opt{raw} || $self->{raw}); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
$entry; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub value { |
59
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
exists $self->{value} |
62
|
|
|
|
|
|
|
? $self->{value} |
63
|
0
|
0
|
|
|
|
|
: $self->{value} = $AttributeSelection->encode($self->{asn}); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |