2 commits - lib/Kolab lib/Kolab.pm
Jeroen van Meeuwen
vanmeeuwen at kolabsys.com
Mon Apr 11 15:53:31 CEST 2011
lib/Kolab.pm | 6 +++---
lib/Kolab/LDAP.pm | 14 ++++++++++----
lib/Kolab/LDAP/Backend/fds.pm | 35 +++++++++++++++++++----------------
3 files changed, 32 insertions(+), 23 deletions(-)
New commits:
commit 1230e80c66ced10252a8db58c589913aa00bb89a
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Mon Apr 11 14:52:24 2011 +0100
Fix references to CVS.
Use .git, not +git
diff --git a/lib/Kolab.pm b/lib/Kolab.pm
index 0c743bf..fa8c61a 100644
--- a/lib/Kolab.pm
+++ b/lib/Kolab.pm
@@ -62,12 +62,12 @@ our @EXPORT = qw(
our $KOLAB_BASE_VERSION = "2.3";
# Are current releases cvs based or is this a real release?
-my $KOLAB_CVS = 1;
+my $KOLAB_GIT = 1;
our $KOLAB_RELEASE = sprintf "%0004d%02d%02d", ((gmtime)[5] + 1900), ((gmtime)[4] + 1), (gmtime)[3];
-if ($KOLAB_CVS) {
- our $KOLAB_VERSION = $KOLAB_BASE_VERSION . "+git";
+if ($KOLAB_GIT) {
+ our $KOLAB_VERSION = $KOLAB_BASE_VERSION . "git";
our $VERSION = $KOLAB_VERSION . $KOLAB_RELEASE;
} else {
our $KOLAB_VERSION = $KOLAB_BASE_VERSION;
commit 4849d5b5ad3395161c58d12715c66f6d10bee633
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Mon Apr 11 14:50:11 2011 +0100
First steps to fixing the FDS backend
diff --git a/lib/Kolab/LDAP.pm b/lib/Kolab/LDAP.pm
index e6c2ae5..866f19b 100644
--- a/lib/Kolab/LDAP.pm
+++ b/lib/Kolab/LDAP.pm
@@ -379,12 +379,18 @@ sub isObject
my $class = shift;
my $classes = $object->get_value('objectClass', asref => 1);
- return 0 if !defined($classes);
- foreach my $oc (@$classes) {
- if ($oc =~ /$class/i) {
- return 1;
+ if !defined($classes) {
+ Kolab::log('L', 'No attribute objectClass for object', KOLAB_DEBUG);
+ return 0;
+ } else {
+ # Loop through the object classes and see which one matches
+ foreach my $oc (@$classes) {
+ if ($oc =~ /$class/i) {
+ return 1;
+ }
}
}
+ # Ultimately, pretend nothing happened
return 0;
}
diff --git a/lib/Kolab/LDAP/Backend/fds.pm b/lib/Kolab/LDAP/Backend/fds.pm
index 16044d7..9d35610 100644
--- a/lib/Kolab/LDAP/Backend/fds.pm
+++ b/lib/Kolab/LDAP/Backend/fds.pm
@@ -99,26 +99,31 @@ sub changeCallback
return;
}
- if (!Kolab::LDAP::isObject($entry, $Kolab::config{'user_object_class'}) &&
- !Kolab::LDAP::isObject($entry, 'kolab')) {
- Kolab::log('FDS', "Entry is not a `" . $Kolab::config{'user_object_class'} . "' or kolab configuration object, returning", KOLAB_DEBUG);
- return;
- }
+ # The entry is the parent object in case of a deletion.
+# if (!Kolab::LDAP::isObject($entry, $Kolab::config{'user_object_class'}) &&
+# !Kolab::LDAP::isObject($entry, 'kolab')) {
+# Kolab::log('FDS', "Entry is not a `" . $Kolab::config{'user_object_class'} . "' or kolab configuration object, returning", KOLAB_DEBUG);
+# return;
+# }
FOO:
Kolab::log('FDS', "Calling Kolab::LDAP::sync", KOLAB_DEBUG);
Kolab::LDAP::sync;
+
system($Kolab::config{'kolabconf_script'}) == 0 || Kolab::log('SD', "Failed to run kolabconf: $?", KOLAB_ERROR);
- Kolab::log('FDS', "Finished Kolab::LDAP::sync sleeping 1s", KOLAB_DEBUG);
- sleep 1; # we get too many bogus change notifications!
-
-# my $deleted = $entry->get_value($Kolab::config{'user_field_deleted'}) || 0;
-# if ($deleted) {
-# Kolab::LDAP::deleteObject($ldap, $cyrus, $entry);
-# return;
-# }
+
+ Kolab::log('FDS', "Finished Kolab::LDAP::sync, sleeping for 5 seconds", KOLAB_DEBUG);
+
+ sleep 5; # we get too many bogus change notifications!
+
+# my $deleted = $entry->get_value($Kolab::config{'user_field_deleted'}) || 0;
+# if ($deleted) {
+# Kolab::LDAP::deleteObject($ldap, $cyrus, $entry);
+# return;
+# }
#
-# Kolab::LDAP::createObject($ldap, $cyrus, $entry);
+# Kolab::LDAP::createObject($ldap, $cyrus, $entry);
+
}
sub run {
@@ -199,8 +204,6 @@ sub run {
],
);
-# $status = ldap_create_persistentsearch_control($ld,$changetypes,$changesonly,$return_echg_ctrls,$ctrl_iscritical,$ctrlp);
-
Kolab::log('FDS', "Change notification registered on `$userdn'");
}
More information about the commits
mailing list