summaryrefslogtreecommitdiff
path: root/lib
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 /lib
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)
Diffstat (limited to 'lib')
-rw-r--r--lib/Kolab/LDAP.pm14
1 files changed, 14 insertions, 0 deletions
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