From 39c775f36677b3af45af15146803927dffadee41 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Mon, 25 Feb 2008 17:18:39 +0000 Subject: [PATCH] bugfix: query_jobdb git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9113 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/modules/GosaPackages.pm | 10 ++++++---- gosa-si/modules/GosaSupportDaemon.pm | 13 +++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index b71485cfc..5c9bb9a47 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -264,7 +264,7 @@ sub process_incoming_msg { my @msg_l; my @out_msg_l; - &main::daemon_log("GosaPackages: receive '$header'", 1); + &main::daemon_log("DEBUG: GosaPackages: receive '$header'", 8); if ($header =~ /^job_/) { @msg_l = &process_job_msg($msg, $msg_hash, $session_id); @@ -273,7 +273,7 @@ sub process_incoming_msg { @msg_l = &process_gosa_msg($msg, $msg_hash, $session_id); } else { - &main::daemon_log("ERROR: $header is not a valid GosaPackage-header, need a 'job_' or a 'gosa_' prefix"); + &main::daemon_log("ERROR: $header is not a valid GosaPackage-header, need a 'job_' or a 'gosa_' prefix", 1); } foreach my $out_msg ( @msg_l ) { @@ -407,10 +407,12 @@ sub process_job_msg { sub query_jobdb { my ($msg) = @_; my $msg_hash = &transform_msg2hash($msg); + my $target = @{$msg_hash->{'target'}}[0]; + my $source = @{$msg_hash->{'source'}}[0]; # prepare query sql statement my $select= &get_select_statement($msg, $msg_hash); - my $table= $main::job_queue_table_name; + my $table= $main::job_queue_tn; my $where= &get_where_statement($msg, $msg_hash); my $limit= &get_limit_statement($msg, $msg_hash); my $orderby= &get_orderby_statement($msg, $msg_hash); @@ -418,7 +420,7 @@ sub query_jobdb { # execute db query my $res_hash = $main::job_db->select_dbentry($sql_statement); - my $out_xml = &db_res2xml($res_hash); + my $out_xml = &db_res2si_msg($res_hash, "query_jobdb", $target, $source); my @out_msg_l = ( $out_xml ); return @out_msg_l; } diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index 6fecf1bb3..2044f54c1 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -11,6 +11,7 @@ my @functions = ( "get_time", "build_msg", "db_res2xml", + "db_res2si_msg", "get_where_statement", "get_select_statement", "get_update_statement", @@ -304,6 +305,18 @@ sub db_res2xml { } +sub db_res2si_msg { + my ($db_res, $header, $target, $source) = @_; + + my $si_msg = ""; + $si_msg .= "
$header
"; + $si_msg .= "$source"; + $si_msg .= "$target"; + $si_msg .= &db_res2xml; + $si_msg .= "
"; +} + + sub get_where_statement { my ($msg, $msg_hash) = @_; my $error= 0; -- 2.30.2