steffen: server/kolabd/kolabd kolab_bootstrap.in,1.4,1.5
cvs at intevation.de
cvs at intevation.de
Tue Oct 4 14:48:21 CEST 2005
Author: steffen
Update of /kolabrepository/server/kolabd/kolabd
In directory doto:/tmp/cvs-serv31210/kolabd
Modified Files:
kolab_bootstrap.in
Log Message:
Issue832 implemented (user-defined toplevel DN for Kolab)
Index: kolab_bootstrap.in
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/kolab_bootstrap.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- kolab_bootstrap.in 2 Oct 2005 11:06:31 -0000 1.4
+++ kolab_bootstrap.in 4 Oct 2005 12:48:19 -0000 1.5
@@ -310,6 +310,7 @@
$base_dn .= "dc=$dc,";
}
chop $base_dn;
+ $base_dn = getUserInput("Top level DN for Kolab", $base_dn);
print " base_dn : $base_dn\n";
}
if ($bind_dn =~ /\@\@\@/) {
@@ -479,9 +480,10 @@
my $mesg = $ldap->search(base=> "$base_dn", scope=> 'exact', filter=> "(objectclass=*)");
if ($mesg && $mesg->count != 1) {
print "no $base_dn object found, creating one\n";
- my $dccomp = (split(/\./,$domain))[0];
- chomp $dccomp;
- $mesg = $ldap->add( $base_dn, attr=> [dc=> $dccomp, 'objectclass'=> ['top', 'domain'] ]);
+ $base_dn =~ m/([^=]+)=([^,]+)/;
+ my @attrs = ( $1 => $2, 'objectclass'=> ['top', 'domain'] );
+ @attrs = ( @attrs, 'dc' => (split(/,/,$domain))[0] ) if( $1 ne 'dc' );
+ $mesg = $ldap->add( $base_dn, attr=> \@attrs);
}
$mesg && $mesg->code && warn "failed to write basedn entry : ", $mesg->error;
my $ldapobject = newOrExistingLDAPEntry( $ldap, "k=kolab,$base_dn" );
More information about the commits
mailing list