Net::LD...:PreRead(3)
πΈ NAME πΈ
okay so this is Net::LD...:PreRead(3) β the Net::LDAP::Control::PreRead page from the User Contributed Perl Documentation, bestie β and it's all about the LDAPv3 Pre-Read control object. β¨
β¨ SYNOPSIS β¨
This is the exact starter pack, so copy it, run it, live it:
use Net::LDAP;
use Net::LDAP::Control::PreRead;
use Net::LDAP::Constant qw( LDAP_CONTROL_PREREAD LDAP_SUCCESS );
$ldap = Net::LDAP->new( "ldap.mydomain.eg" );
$preread = Net::LDAP::Control::PreRead->new( attrs => [ qw/givenName/ ] );
my $mesg = $ldap->modify( "cn=Barbara Jensen, o=University of Michigan, c=US",
replace => { givenName => "Babs" },
control => $preread );
if ($mesg->code eq LDAP_SUCCESS) {
my ($previous) = $mesg->control( LDAP_CONTROL_PREREAD );
my $entry = $previous ? $previous->entry() : undef;
if ($entry) {
print "givenName changed from '" .
join("', '", $entry->get_value(givenName") .
"' to 'Babs'\n");
}
}
ngl the get_value(givenName") bit is copied exactly as the page has it β we do not edit manpage code in this group chat, periodt. π
π¦ DESCRIPTION π¦
Net::LDAP::Control::PreRead provides an interface for the creation and manipulation of objects that represent the Pre-Read Controls as described by RFC 4527. That's the whole vibe. π«Ά
In modification operations, the Pre-Read request control tells the server that a copy of the original entry before the update is to be returned. After the successful completion of the operation, the accompanying Pre-Read response control lets you retrieve the original value from the server's response. Iconic behavior, honestly. π
One use case of this control may be to obtain replaced or deleted values of modified attributes or a copy of the entry being deleted. Practical queen energy fr fr. π
π CONSTRUCTOR ARGUMENTS π
On top of the constructor arguments described in Net::LDAP::Control, the following are provided. π
attrs => [ ATTR, ... ]β A list of attributes to be returned in the entry returned in the response control.
If absent, all attributes are returned.
Operational attributes may be included in the list by explicitly asking for them or by using special "+" feature (provided the server supports this feature).
π METHODS π
As with Net::LDAP::Control, each constructor argument described above is also available as a method on the object. Call it with no argument and it returns the current value for the attribute; call it with an argument and it sets a new value for the attribute. Slay. π
In addition to these methods, the control also supports the following method:
entry()β Returns the entry from the response control in the response message to the LDAP request that contained the request control.
The result is either a Net::LDAP::Entry object or undefined.
π₯ SEE ALSO π₯
Net::LDAPNet::LDAP::Controlhttp://www.ietf.org/rfc/rfc4527.txt
π AUTHOR π
Peter Marschall <peter@adpm.de>
Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>.
π COPYRIGHT π
Copyright (c) 2008,2011 Peter Marschall. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay bye bestie, this page is perl v5.42.0, dated 2024-01-02 β mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-ldap 0.68-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms