index dd383b3d0a5fd73f8fc679507203f67ed1704d3d..6870505827e081406b744f3d1cb27a6f5002de92 100644 (file)
my $sql_statement= "SELECT $select FROM $table $where $orderby $limit";
my $res_hash = $db->select_dbentry($sql_statement);
- my $out_xml = &db_res2si_msg($res_hash, $header, $target, $source);
+ my $out_xml = &db_res2si_msg($res_hash, $header, $source, $target);
#$out_xml =~ s/<\/xml>/<session_id>$session_id<\/session_id><\/xml>/;
my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
if (defined $forward_to_gosa) {
my $source = @{$msg_hash->{'source'}}[0];
# prepare query sql statement
- my $table= $main::job_queue_tn;
my $where= &get_where_statement($msg, $msg_hash);
- my $sql_statement = "DELETE FROM $table $where";
- &main::daemon_log("$session_id DEBUG: $sql_statement",7);
- # execute db query
- my $db_res = $main::job_db->del_dbentry($sql_statement);
- my $res;
- if( $db_res > 0 ) {
- $res = 0 ;
- } else {
- $res = 1;
- }
+ #my $sql_statement = "DELETE FROM $main::job_queue_tn $where";
+ #&main::daemon_log("$session_id DEBUG: $sql_statement",7);
+ # execute db query
+ #my $db_res = $main::job_db->del_dbentry($sql_statement);
+ #
+ #my $res;
+ #if( $db_res > 0 ) {
+ # $res = 0 ;
+ #} else {
+ # $res = 1;
+ #}
+ # set job to status 'done', job will be deleted automatically
+ my $sql_statement = "UPDATE $main::job_queue_tn ".
+ "SET status='done', modified='1' ".
+ "$where";
+ &main::daemon_log("$session_id DEBUG: $sql_statement", 7);
+ my $res = $main::job_db->update_dbentry( $sql_statement );
+
# prepare xml answer
my $out_xml = "<xml><header>answer</header><source>$target</source><target>$source</target><answer1>$res</answer1><session_id>$session_id</session_id></xml>";
my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
if (defined $forward_to_gosa) {
- #&add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
$out_xml =~s/<\/xml>/<forward_to_gosa>$forward_to_gosa<\/forward_to_gosa><\/xml>/;
}
}
my $out_msg = sprintf("<xml><header>answer</header><source>%s</source><target>%s</target>%s<session_id>$session_id</session_id></xml>", $target, $source, $out_xml);
+ my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
if (defined $forward_to_gosa) {
#&add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
$out_xml =~s/<\/xml>/<forward_to_gosa>$forward_to_gosa<\/forward_to_gosa><\/xml>/;
return @out_msg_l;
}
+
+=pod
+
+=head1 NAME
+
+databases - Implementation of a GOsa-SI event module for GOsa-SI-server.
+
+=head1 SYNOPSIS
+
+ use GOSA::GosaSupportDaemon;
+
+=head1 DESCRIPTION
+
+This GOsa-SI event module containing all functions to handle messages coming from GOsa and concerning GOsa-SI databases.
+
+This module will be automatically imported by GOsa-SI if it is under F</usr/lib/gosa-si/server/E<lt>PACKAGEMODULEE<gt>/> .
+
+=head1 METHODS
+
+=over 4
+
+=item get_events ( )
+
+=item query_jobdb ( )
+
+=item count_jobdb ( )
+
+=item delete_jobdb_entry ( )
+
+=item clear_jobdb ( )
+
+=item update_status_jobdb_entry ( )
+
+=item query_packages_list ( )
+
+=item count_packages_list ( )
+
+=item query_fai_server ( )
+
+=item count_fai_server ( )
+
+=item query_fai_release ( )
+
+=item count_fai_release ( )
+
+=back
+
+=head1 BUGS
+
+Please report any bugs, or post any suggestions, to the GOsa mailing list E<lt>gosa-devel@oss.gonicus.deE<gt> or to L<https://oss.gonicus.de/labs/gosa>
+
+=head1 COPYRIGHT
+
+This code is part of GOsa (L<http://www.gosa-project.org>)
+
+Copyright (C) 2003-2008 GONICUS GmbH
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+=cut
+
+
1;