Code

Report unit tag failures to client.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Mar 2008 14:58:21 +0000 (14:58 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Mar 2008 14:58:21 +0000 (14:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9680 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/client/events/corefunctions.pm
gosa-si/modules/SIPackages.pm

index 59337b4aac0fbbc76d5018bbac4512fa2d331a7b..663daa89b84ee9091beee5b0d7f69d30f6f49958 100644 (file)
@@ -121,6 +121,11 @@ sub registered {
                   @{$msg_hash->{'ldap_available'}}[0] eq "true") {
        print $opts_file_FH "LDAP_AVAILABLE=\"true\"\n";
        }
+    if(defined(@{$msg_hash->{'error'}})) {
+               my $errormsg= @{$msg_hash->{'error'}}[0];
+       print $opts_file_FH "GOSA_SI_ERROR=\"$errormsg\"\n";
+               &write_to_file($errormsg, $fai_logpath);
+       }
     close($opts_file_FH);
      
     my $out_msg = &create_xml_string($out_hash);
index 9f250969ecba80d8ebf57bfac3c8acb928c6b67a..787baff7f130dee2b1c8d91d0d83ad116d53b5e1 100644 (file)
@@ -580,14 +580,16 @@ sub here_i_am {
     # give the new client his ldap config
     # Workaround: Send within the registration response, if the client will get an ldap config later
     my $new_ldap_config_out = &new_ldap_config($source);
-    if( $new_ldap_config_out ) {
-            &add_content2xml_hash($out_hash, "ldap_available", "true");
-    }
+       if( $new_ldap_config_out && (!($new_ldap_config_out =~ /error/ ))) {
+               &add_content2xml_hash($out_hash, "ldap_available", "true");
+       } elsif ($new_ldap_config_out && $new_ldap_config_out =~ /error/){
+               &add_content2xml_hash($out_hash, "error", $new_ldap_config_out);
+       }
     my $register_out = &create_xml_string($out_hash);
     push(@out_msg_l, $register_out);
 
     # Really send the ldap config
-    if( $new_ldap_config_out ) {
+    if( $new_ldap_config_out  (!($new_ldap_config_out =~ /error/))) {
             push(@out_msg_l, $new_ldap_config_out);
     }
 
@@ -791,13 +793,13 @@ sub new_ldap_config {
                #$mesg->code && die $mesg->error;
                if($mesg->code) {
                        &main::daemon_log($mesg->error, 1);
-                       return;
+                       return "error-unit-tag-count-0";
                }
 
                # Sanity check
                if ($mesg->count != 1) {
                        &main::daemon_log("WARNING: cannot find administrative unit for client with tag $unit_tag", 1);
-                       return;
+                       return "error-unit-tag-count-".$mesg->count;
                }
 
                $entry= $mesg->entry(0);