Code

Fixed style.
[gosa.git] / gosa-si / modules / GosaSupportDaemon.pm
index 182e920bfc6236249b7b3ea95be4be1c8a04ea40..270666e7992b52c0e16992812ace61e1eb2bad13 100644 (file)
@@ -199,7 +199,10 @@ sub create_xml_string {
 sub encrypt_msg {
     my ($msg, $my_cipher) = @_;
     if(not defined $my_cipher) { print "no cipher object\n"; }
-    $msg = "\0"x(16-length($msg)%16).$msg;
+    {
+      use bytes;
+      $msg = "\0"x(16-length($msg)%16).$msg;
+    }
     $msg = $my_cipher->encrypt($msg);
     chomp($msg = &encode_base64($msg));
 
@@ -310,17 +313,20 @@ sub send_msg ($$$$$) {
                        &add_content2xml_hash($out_hash, $key, $value);
                }
        }
-
-       &send_msg_hash2address($out_hash, $to, $hostkey);
+    my $out_msg = &create_xml_string($out_hash);
+    return $out_msg;
 }
 
 
 sub get_where_statement {
-    my ($msg, $msg_hash)= @_;
+    my ($msg, $msg_hash) = @_;
     my $error= 0;
     
     my $clause_str= "";
-    if( not exists @{$msg_hash->{'where'}}[0]->{'clause'} ) { $error++; };
+    if( (not exists $msg_hash->{'where'}) || (not exists @{$msg_hash->{'where'}}[0]->{'clause'}) ) { 
+        $error++; 
+    }
+
     if( $error == 0 ) {
         my @clause_l;
         my @where = @{@{$msg_hash->{'where'}}[0]->{'clause'}};