summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2010-06-27 06:17:18 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2010-06-27 06:17:18 (GMT)
commit08aea6f0137411e9ef84a7e4d18f8e2094076c56 (patch)
treedece25f9959a521cc5599097bd0f10f55eaa81c1
parenteaa499070691f5c5037f9a2004a6af83c195a740 (diff)
downloadperl-Kolab-08aea6f0137411e9ef84a7e4d18f8e2094076c56.tar.gz
Support a hooks directory that allows to extend the deletion of users.
kolab/issue3472 (web client user prefs not deleted when user gets deleted) kolab/issue3470 (Free/Busy cache not deleted when user gets deleted)
-rw-r--r--ChangeLog10
-rw-r--r--lib/Kolab/LDAP.pm14
2 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e15495..006592c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-06-27 Gunnar Wrobel <p@rdus.de>
+
+ * lib/Kolab/LDAP.pm (deleteObject):
+
+ Support a hooks directory that allows to extend the deletion of
+ users.
+
+ kolab/issue3472 (web client user prefs not deleted when user gets
+ deleted)
+
2010-04-27 Thomas Arendsen Hein <thomas@intevation.de>
* sbin/kolab_bootstrap.in: Check for availability of submission port,
diff --git a/lib/Kolab/LDAP.pm b/lib/Kolab/LDAP.pm
index ba8f44c..36a513d 100644
--- a/lib/Kolab/LDAP.pm
+++ b/lib/Kolab/LDAP.pm
@@ -719,6 +719,20 @@ sub deleteObject
}
}
+ my $hooksdir = $Kolab::config{'kolab_hooksdir'} . '/delete';
+ opendir(DIR, $hooksdir) or Kolab::log('T', 'Given hook directory $hooksdir does not exist!', KOLAB_ERROR );
+ my @hooks = grep { /^hook-/ } readdir (DIR);
+ closedir(DIR);
+
+ foreach my $hook (@hooks) {
+ system($hook . ' $uid');
+ if ($?==0) {
+ Kolab::log('L', "Successfully ran hook $hook for user $uid.", KOLAB_DEBUG);
+ } else {
+ Kolab::log('L', "Failed running hook $hook for user $uid.", KOLAB_ERROR);
+ }
+ }
+
# FIXME
# This is a horrible fix for kolab/issue3472. kolabd is a simple
# deamon that should react to changes within LDAP. It should NOT