summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 352132d)
raw | patch | inline | side by side (parent: 352132d)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 11 May 2009 15:05:30 +0000 (15:05 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 11 May 2009 15:05:30 +0000 (15:05 +0000) |
Closes #630
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13646 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13646 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/modules/ClientPackages.pm | patch | blob | history |
index 62662fa3bdfacd99c460bb7a5e0d49ed00eed151..4a83e1664c7320020b0ad91eb0333f52ac52f8be 100644 (file)
my $server_address = "$server_ip:$server_port";
$main::server_address = $server_address;
+{
+ # Check if ou=incoming exists
+ # TODO: This should be transferred to a module init-function
+ my $ldap_handle = &main::get_ldap_handle();
+ if( defined($ldap_handle) ) {
+ &main::daemon_log("0 DEBUG: Searching for ou=incoming container for new clients", 9);
+ # Perform search
+ my $mesg = $ldap_handle->search(
+ base => $ldap_base,
+ scope => 'one',
+ filter => "(&(ou=incoming)(objectClass=organizationalUnit))"
+ );
+ if(not defined($mesg->count) or $mesg->count == 0) {
+ my $incomingou = Net::LDAP::Entry->new();
+ $incomingou->dn('ou=incoming,'.$ldap_base);
+ $incomingou->add('objectClass' => 'organizationalUnit');
+ my $result = $incomingou->update($ldap_handle);
+ if($result != 0) {
+ &main::daemon_log("0 ERROR: Problem adding ou=incoming: '".$result->errorMessage."'!", 1);
+ }
+ }
+ }
+ &main::release_ldap_handle($ldap_handle);
+}
+
### functions #################################################################