steffen: server/perl-kolab/Kolab-Conf Conf.pm,1.14,1.15
cvs at intevation.de
cvs at intevation.de
Tue Jun 8 12:40:16 CEST 2004
Author: steffen
Update of /kolabrepository/server/perl-kolab/Kolab-Conf
In directory doto:/tmp/cvs-serv17876/Kolab-Conf
Modified Files:
Conf.pm
Log Message:
fix for groups (#168)
Index: Conf.pm
===================================================================
RCS file: /kolabrepository/server/perl-kolab/Kolab-Conf/Conf.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- Conf.pm 7 Jun 2004 19:58:07 -0000 1.14
+++ Conf.pm 8 Jun 2004 10:40:14 -0000 1.15
@@ -177,7 +177,7 @@
my $oldcfg = $cfg . '.old';
copy($cfg, $oldcfg);
chown($Kolab::config{'kolab_uid'}, $Kolab::config{'kolab_gid'}, $oldcfg);
- copy("$prefix/etc/kolab/transport.template", $cfg);
+ copy("$prefix/etc/kolab/templates/transport.template", $cfg);
my $transport;
if (!($transport = IO::File->new($cfg, 'a'))) {
@@ -243,7 +243,7 @@
my $prefix = $Kolab::config{'prefix'};
my $cyrustemplate;
- if (!($cyrustemplate = IO::File->new("$prefix/etc/kolab/cyrus.conf.template", 'r'))) {
+ if (!($cyrustemplate = IO::File->new("$prefix/etc/kolab/templates/cyrus.conf.template", 'r'))) {
Kolab::log('T', "Unable to open template file `cyrus.conf.template'", KOLAB_ERROR);
exit(1);
}
@@ -307,7 +307,7 @@
my $oldcfg = $cfg . '.old';
copy($cfg, $oldcfg);
chown($Kolab::config{'kolab_uid'}, $Kolab::config{'kolab_gid'}, $oldcfg);
- copy("$prefix/etc/kolab/imapd.group.template", $cfg);
+ copy("$prefix/etc/kolab/templates/imapd.group.template", $cfg);
my $groupconf;
if (!($groupconf = IO::File->new($cfg, 'a'))) {
Kolab::log('T', "Unable to open configuration file `$cfg'", KOLAB_ERROR);
@@ -324,7 +324,7 @@
my $mesg = $ldap->search(
base => $Kolab::config{'base_dn'},
scope => 'sub',
- filter => '(objectclass=groupofnames)'
+ filter => '(objectclass=groupOfNames)'
);
if ($mesg->code) {
Kolab::log('T', 'Unable to locate Cyrus groups in LDAP', KOLAB_ERROR);
@@ -336,8 +336,16 @@
if ($mesg->code <= 0) {
foreach $ldapobject ($mesg->entries) {
my $group = $ldapobject->get_value('cn') . ":*:$count:";
- my $userlist = $ldapobject->get_value('uid', asref => 1);
- foreach (@$userlist) { $group .= "$_,"; }
+ my $userlist = $ldapobject->get_value('member', asref => 1);
+ foreach (@$userlist) {
+ my $uid = $_;
+ my $umesg = $ldap->search( base => $uid,
+ scope => 'exact',
+ filter => '(objectClass=*)' );
+ if ($umesg->code <= 0 && $umesg->count() == 1 ) {
+ $group .= $umesg->entry(0)->get_value('uid').',';
+ }
+ }
$group =~ s/,$//;
print $groupconf $group . "\n";
Kolab::log('T', "Adding cyrus group `$group'");
More information about the commits
mailing list