Closed
Bug 55056
Opened 24 years ago
Closed 20 years ago
RFE: Method for returning LDIF of actions taken during $conn->update($entry)
Categories
(Directory :: PerLDAP, enhancement, P3)
Directory
PerLDAP
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: dg50, Assigned: leif)
Details
I have a number of programs that extract data from databases, pull the matching
entry from the directory, and update all the attributes that have changed.
I also want to be able to log these changes in LDIF format, both for auditing
purposes, and because if something goes pear-shaped, the log entry can be
applied with the ldapmodify command line tool.
A fair amount of housekeeping effor is expended keeping track of what attributes
have been changed, and (in particular) how they have been changed, so that an
LDIF file of the changes can be generated.
It strikes me, though, that this houskeeping is rightly part of the PerLDAP
module, not me.
What is requested is a method that functions similar to:
$CHANGES{'telephoneNumber'} = '555-666-7777';
$CHANGES{'mail'} = 'theRIAAsucks@napster.com';
foreach $changed_attr (keys %CHANGES) {
$entry->setValue($changed_attr, $CHANGES{$changed_attr))
unless $entry->hasValue($changed_attr, $CHANGES{$changed_attr));
}
# Toss in some other stuff
$entry->addValue('mail', '3133t3@slashdot.org');
$entry->addValue('pager', '555-666-8888');
$entry->remove('jpegPhoto');
$conn->update($entry);
# This should work even if something went wrong during the update
$ldif = $entry->get_changes_ldif();
print $ldif;
-------------------------------
output
dn: uid=myID,ou=gurus,o=dcx.com
changetype: modify
replace: telephoneNumber
telephoneNumber: 555-666-7777
-
replace: mail
mail: the RIAAsucks@napster.com
mail: 3133t3@slashdot.org
-
add: pager
pager: 555-666-8888
-
delete: jpegPhoto
--------------------------
It seems simple enough to do:
1) Create an $ldif_changes_string as part of the $entry data structure
2) Build the $ldif_changes_string during the $conn->update call
3) Add a method to return its contents
...but I don't have CVS access from behind our firewall to patch it myself.
BTW, when are we going to see another PerLDAP FTP release?
DG
Assignee | ||
Comment 1•24 years ago
|
||
We have some code submitted to us for these things. It will be added in v2.0,
which is actually being developed (believe it or not). AOL has allowed me to
work on PerLDAP as part of my job description.
v1.4.1 seems stable, and I will release it shortly.
-- Leif
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•20 years ago
|
||
Since v2.0 of PerLDAP is a pipe dream, I'm closing this one for now. If anyone
is willing to write this in the next 3-4 weeks, I'll include it for v1.5, the
next and final PerLDAP release.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•