I've installed oxldapsync from http://software.open-xchange.com/OX6...po/DebianEtch/ on a lenny-based OX6 system. Although this setup is not supported, I think my observation might be of interest:
When I sync groups from LDAP to OX, some of them fail due to duplicate members of those groups. E.g. I have a group "exmitarb" which holds 33 members, but the resulting creategroup command contains an "-a" list that holds 39 IDs, of which 6 are duplicates.
The perl code that grabs the groupshash from LDAP seems to be ok. However, I must say, that I am not perl guru. So far, I ended up with this small patch, which works for me, but maybe, someone else knows a better solution.
-frank
When I sync groups from LDAP to OX, some of them fail due to duplicate members of those groups. E.g. I have a group "exmitarb" which holds 33 members, but the resulting creategroup command contains an "-a" list that holds 39 IDs, of which 6 are duplicates.
The perl code that grabs the groupshash from LDAP seems to be ok. However, I must say, that I am not perl guru. So far, I ended up with this small patch, which works for me, but maybe, someone else knows a better solution.
Code:
--- /opt/oxldapsync/lib/OX/Group/Helper.pm 2009-04-06 17:35:18.000000000 +0200
+++ Helper.pm 2009-05-13 16:56:58.000000000 +0200
@@ -216,9 +216,12 @@
my @currentmembers = split(",",$groups[$self->findGroup($group)]{'members'});
my @newmemberuids;
+ my %is_done;
for (my $idx=0;$members[$idx];$idx++)
{
+ if (! $is_done{$members[$idx]}) {
+ $is_done{$members[$idx]} = 1;
if (defined(my $uid = $self->findUser($members[$idx])))
{
if ((my $memidx = $self->isMember($users[$uid]{'id'}, @currentmembers)) > -1 )
@@ -228,6 +231,7 @@
push @newmemberuids, $users[$uid]{'id'};
}
}
+ }
}
if ($#currentmembers > -1 )
Comment