1Net::LDAP::Control::PreURseeard(C3o)ntributed Perl DocumNeentt:a:tLiDoAnP::Control::PreRead(3)
2
3
4

NAME

6       Net::LDAP::Control::PreRead - LDAPv3 Pre-Read control object
7

SYNOPSIS

9        use Net::LDAP;
10        use Net::LDAP::Control::PreRead;
11        use Net::LDAP::Constant qw( LDAP_CONTROL_PREREAD LDAP_SUCCESS );
12
13        $ldap = Net::LDAP->new( "ldap.mydomain.eg" );
14
15        $preread = Net::LDAP::Control::PreRead->new( attrs => [ qw/givenName/ ] );
16
17        my $mesg = $ldap->modify( "cn=Barbara Jensen, o=University of Michigan, c=US",
18                                  replace => { givenName => "Babs" },
19                                  control => $preread );
20
21        if ($mesg->code eq LDAP_SUCCESS) {
22          my ($previous) = $mesg->control( LDAP_CONTROL_PREREAD );
23          my $entry = $previous ? $previous->entry() : undef;
24
25          if ($entry) {
26            print "givenName changed from '" .
27                  join("', '", $entry->get_value(givenName") .
28                  "' to 'Babs'\n");
29          }
30        }
31

DESCRIPTION

33       "Net::LDAP::Control::PreRead" provides an interface for the creation
34       and manipulation of objects that represent the "Pre-Read Controls" as
35       described by RFC 4527.
36
37       In modification operations, the "Pre-Read request control" indicates to
38       the server that a copy of the original entry before the update is to be
39       returned.  After the successful completion of the operation, the
40       accompanying "Pre-Read response control" allows one to retrieve the
41       original value from the servers's response.
42
43       One use case of this control control may be to obtain replaced or
44       deleted values of modified attributes or a copy of the entry being
45       deleted.
46

CONSTRUCTOR ARGUMENTS

48       In addition to the constructor arguments described in
49       Net::LDAP::Control the following are provided.
50
51       attrs => [ ATTR, ... ]
52           A list of attributes to be returned in the entry returned in the
53           response control.
54
55           If absent, all attributes are returned.
56
57           Operational attributes may be included in the list by explicitly
58           asking for them or by using special "+" feature (provided the
59           server supports this feature).
60

METHODS

62       As with Net::LDAP::Control each constructor argument described above is
63       also available as a method on the object which will return the current
64       value for the attribute if called without an argument, and set a new
65       value for the attribute if called with an argument.
66
67       In addition to these methods, the control also supports the following
68       method:
69
70       entry ()
71           Returns the entry from the response control in the response message
72           to the LDAP request that contained the request control.
73
74           The result is either a Net::LDAP::Entry object or undefined.
75

SEE ALSO

77       Net::LDAP, Net::LDAP::Control, http://www.ietf.org/rfc/rfc4527.txt
78

AUTHOR

80       Peter Marschall <peter@adpm.de>
81
82       Please report any bugs, or post any suggestions, to the perl-ldap
83       mailing list <perl-ldap@perl.org>
84
86       Copyright (c) 2008,2011 Peter Marschall. All rights reserved. This
87       program is free software; you can redistribute it and/or modify it
88       under the same terms as Perl itself.
89
90
91
92perl v5.16.3                      2013-06-07    Net::LDAP::Control::PreRead(3)
Impressum