summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f1e3c8)
raw | patch | inline | side by side (parent: 6f1e3c8)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Jan 2008 16:55:40 +0000 (16:55 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Jan 2008 16:55:40 +0000 (16:55 +0000) |
input parameter changes!
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8572 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8572 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 351878bc6199f9107a3297ce2d34c318459df50c..a34e5c97cb43c061b496353f7d20dae4579acae6 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
my $tmp = &{ $module."::process_incoming_msg" }($input.".".$heap->{remote_ip}."\n");
if (defined $tmp) {
$answer = $tmp;
+ daemon_log("Got answer from module ".$module.": \n".$answer,8);
}
- daemon_log("Got answer from module ".$module.": ".$answer,8);
}
daemon_log("processing of msg finished", 5);
my ($kernel,$heap) = @_[KERNEL, HEAP];
# check gosa job queue for jobs with executable timestamp
-# my ($seconds, $minutes, $hours, $monthday, $month,
-# $year, $weekday, $yearday, $sommertime) = localtime(time);
-# $hours = $hours < 10 ? $hours = "0".$hours : $hours;
-# $minutes = $minutes < 10 ? $minutes = "0".$minutes : $minutes;
-# $seconds = $seconds < 10 ? $seconds = "0".$seconds : $seconds;
-# $month+=1;
-# $month = $month < 10 ? $month = "0".$month : $month;
-# $monthday = $monthday < 10 ? $monthday = "0".$monthday : $monthday;
-# $year+=1900;
-# my $timestamp = "$year$month$monthday$hours$minutes$seconds";
my $timestamp = &get_time();
- my $res = $job_db->select_dbentry( { table=>$job_queue_table_name, status=>'waiting', timestamp=>$timestamp } );
+ my $sql_statement = "SELECT * FROM ".$job_queue_table_name.
+ " WHERE status='waiting' AND timestamp<'$timestamp'";
+
+ my $res = $job_db->select_dbentry( $sql_statement );
while( my ($id, $hit) = each %{$res} ) {
my $macaddress = $hit->{macaddress};
my $job_msg_hash = &transform_msg2hash($hit->{xmlmessage});
my $out_msg_hash = $job_msg_hash;
- my $res_hash = $known_clients_db->select_dbentry( {table=>'known_clients', macaddress=>$macaddress} );
+ my $sql_statement = "SELECT * FROM known_clients WHERE macaddress='$macaddress'";
+ my $res_hash = $known_clients_db->select_dbentry( $sql_statement );
# expect macaddress is unique!!!!!!
my $target = $res_hash->{1}->{hostname};
if (not defined $target) {
&daemon_log("ERROR: no host found for mac address: $job_msg_hash->{mac}[0]", 1);
&daemon_log("xml message: $hit->{xmlmessage}", 5);
- my $update_hash = { table=>$job_queue_table_name,
- update=> [ { status=>['error'], result=>["no host found for mac address"] } ],
- where=> [ { id=>[$jobdb_id] } ],
- };
- my $res = $job_db->update_dbentry($update_hash);
-
+ my $sql_statement = "UPDATE $job_queue_table_name ".
+ "SET status='error', result='no host found for mac address' ".
+ "WHERE id='$jobdb_id'";
+ my $res = $job_db->update_dbentry($sql_statement);
next;
}
my $error = &send_msg_hash2address($out_msg_hash, "$gosa_ip:$gosa_port", $gosa_passwd);
if ($error == 0) {
- my $sql = "UPDATE '$job_queue_table_name' SET status='processing', targettag='$target' WHERE id='$jobdb_id'";
- my $res = $job_db->exec_statement($sql);
+ my $sql_statement = "UPDATE $job_queue_table_name ".
+ "SET status='processing', targettag='$target' ".
+ "WHERE id='$jobdb_id'";
+ my $res = $job_db->update_dbentry($sql_statement);
} else {
- my $update_hash = { table=>$job_queue_table_name,
- update=> [ { status=>'error' } ],
- where=> [ { id=>$jobdb_id } ],
- };
- my $res = $job_db->update_dbentry($update_hash);
+ my $sql_statement = "UPDATE $job_queue_table_name ".
+ "SET status='error' ".
+ "WHERE id='$jobdb_id'";
+ my $res = $job_db->update_dbentry($sql_statement);
}
}
@@ -589,4 +582,3 @@ daemon_log("start socket for incoming xml messages at port '$server_port' ", 1);
POE::Kernel->run();
exit;
-
index e03152960c16d113e269f4e4368304dd9cd35ccd..031702871c87002e54d15614811c90fec72aff8f 100644 (file)
# 3 no restriction value ($restric_val) defined
# 4 column name not known in table
# 5 no column names to change specified
+#sub update_dbentry {
+# my $self = shift;
+# my $arg = shift;
+#
+#
+# # check completeness of function parameter
+# # extract table statement from arg hash
+# my $table = $arg->{table};
+# if (not defined $table) {
+# return 1;
+# } else {
+# delete $arg->{table};
+# }
+#
+# # extract where parameter from arg hash
+# my $where_statement = "";
+# if( exists $arg->{where} ) {
+# my $where_hash = @{ $arg->{where} }[0];
+# if( 0 < keys %{ $where_hash } ) {
+# my @where_list;
+# while( my ($rest_pram, $rest_val) = each %{ $where_hash } ) {
+# my $statement;
+# if( $rest_pram eq 'timestamp' ) {
+# $statement = "$rest_pram<'@{ $rest_val }[0]'";
+# } else {
+# $statement = "$rest_pram='@{ $rest_val }[0]'";
+# }
+# push( @where_list, $statement );
+# }
+# $where_statement .= "WHERE ".join('AND ', @where_list);
+# }
+# }
+#
+# # extract update parameter from arg hash
+# my $update_hash = @{ $arg->{update} }[0];
+# my $update_statement = "";
+# if( 0 < keys %{ $update_hash } ) {
+# my @update_list;
+# while( my ($rest_pram, $rest_val) = each %{ $update_hash } ) {
+# my $statement = "$rest_pram='@{ $rest_val }[0]'";
+# push( @update_list, $statement );
+# }
+# $update_statement .= join(', ', @update_list);
+# }
+#
+# my $sql_statement = "UPDATE $table SET $update_statement $where_statement";
+# &create_lock($self,'update_dbentry');
+# my $db_answer = $self->{dbh}->do($sql_statement);
+# &remove_lock($self,'update_dbentry');
+# return $db_answer;
+#}
sub update_dbentry {
- my $self = shift;
- my $arg = shift;
-
-
- # check completeness of function parameter
- # extract table statement from arg hash
- my $table = $arg->{table};
- if (not defined $table) {
- return 1;
- } else {
- delete $arg->{table};
- }
-
- # extract where parameter from arg hash
- my $where_statement = "";
- if( exists $arg->{where} ) {
- my $where_hash = @{ $arg->{where} }[0];
- if( 0 < keys %{ $where_hash } ) {
- my @where_list;
- while( my ($rest_pram, $rest_val) = each %{ $where_hash } ) {
- my $statement;
- if( $rest_pram eq 'timestamp' ) {
- $statement = "$rest_pram<'@{ $rest_val }[0]'";
- } else {
- $statement = "$rest_pram='@{ $rest_val }[0]'";
- }
- push( @where_list, $statement );
- }
- $where_statement .= "WHERE ".join('AND ', @where_list);
- }
- }
-
- # extract update parameter from arg hash
- my $update_hash = @{ $arg->{update} }[0];
- my $update_statement = "";
- if( 0 < keys %{ $update_hash } ) {
- my @update_list;
- while( my ($rest_pram, $rest_val) = each %{ $update_hash } ) {
- my $statement = "$rest_pram='@{ $rest_val }[0]'";
- push( @update_list, $statement );
- }
- $update_statement .= join(', ', @update_list);
- }
-
- my $sql_statement = "UPDATE $table SET $update_statement $where_statement";
- &create_lock($self,'update_dbentry');
- my $db_answer = $self->{dbh}->do($sql_statement);
- &remove_lock($self,'update_dbentry');
+ my ($self, $sql)= @_;
+ my $db_answer= &exec_statement($self, $sql);
return $db_answer;
-}
+}
sub del_dbentry {
- my $self = shift;
- my $arg = shift;
-
-
- # check completeness of function parameter
- # extract table statement from arg hash
- my $table = $arg->{table};
- if (not defined $table) {
- return 1;
- } else {
- delete $arg->{table};
- }
-
- # collect select statements
- my @del_list;
- while (my ($pram, $val) = each %{$arg}) {
- if ( $pram eq 'timestamp' ) {
- push(@del_list, "$pram < '$val'");
- } else {
- push(@del_list, "$pram = '$val'");
- }
- }
-
- my $where_statement;
- if( not @del_list ) {
- $where_statement = "";
- } else {
- $where_statement = "WHERE ".join(' AND ', @del_list);
- }
-
- my $sql_statement = "DELETE FROM $table $where_statement";
- &create_lock($self,'del_dbentry');
- my $db_res = $self->{dbh}->do($sql_statement);
- &remove_lock($self,'del_dbentry');
+ my ($self, $sql)= @_;;
+ my $db_res= &exec_statement($self, $sql);
return $db_res;
}
}
-sub select_dbentry {
- my $self = shift;
- my $arg = shift;
-
-
- # check completeness of function parameter
- # extract table statement from arg hash
- my $table = $arg->{table};
- if (not defined $table) {
- return 1;
- } else {
- delete $arg->{table};
- }
-
- # collect select statements
- my @select_list;
- my $sql_statement;
- while (my ($pram, $val) = each %{$arg}) {
- if ( $pram eq 'timestamp' ) {
- push(@select_list, "$pram < '$val'");
- } else {
- push(@select_list, "$pram = '$val'");
- }
- }
- if (@select_list == 0) {
- $sql_statement = "SELECT * FROM '$table'";
- } else {
- $sql_statement = "SELECT * FROM '$table' WHERE ".join(' AND ', @select_list);
- }
+sub select_dbentry {
+ my ($self, $sql)= @_;
- # query db
- &create_lock($self,'select_dbentry');
- my $query_answer = $self->{dbh}->selectall_arrayref($sql_statement);
- &remove_lock($self,'select_dbentry');
+ my $db_answer= &exec_statement($self, $sql);
# fetch column list of db and create a hash with column_name->column_value of the select query
+ $sql =~ /FROM ([\S]*?) /g;
+ my $table = $1;
my $column_list = &get_table_columns($self, $table);
my $list_len = @{ $column_list } ;
my $answer = {};
my $hit_counter = 0;
-
- foreach my $hit ( @{ $query_answer }) {
+ foreach my $hit ( @{ $db_answer }) {
$hit_counter++;
for ( my $i = 0; $i < $list_len; $i++) {
$answer->{ $hit_counter }->{ @{ $column_list }[$i] } = @{ $hit }[$i];
}
}
-
+
return $answer;
}
sub exec_statement {
my $self = shift;
my $sql_statement = shift;
+
&create_lock($self,'exec_statement');
- my @res = @{$self->{dbh}->selectall_arrayref($sql_statement)};
+ my @db_answer = @{$self->{dbh}->selectall_arrayref($sql_statement)};
&remove_lock($self, 'exec_statement');
- return \@res;
+
+ return \@db_answer;
}
+
sub get_time {
my ($seconds, $minutes, $hours, $monthday, $month,
$year, $weekday, $yearday, $sommertime) = localtime(time);
index 6872485d552acc43988a159fb0c43ccd2bcbb135..88b5b65e07710b9f7e789e0cfcddf880dd37f1b3 100644 (file)
use GOSA::DBsqlite;
use MIME::Base64;
+my $op_hash = {
+ 'eq' => '=',
+ 'ne' => '!=',
+ 'ge' => '>=',
+ 'gt' => '>',
+ 'le' => '<=',
+ 'lt' => '<',
+};
+
BEGIN{}
END{}
} else {
&main::daemon_log("ERROR: $header is not a valid GosaPackage-header, need a 'job_' or a 'gosa_' prefix");
}
-
+
if (not defined $out_msg) {
return;
}
my $out_cipher = &create_ciphering($gosa_passwd);
$out_msg = &encrypt_msg($out_msg, $out_cipher);
+
return $out_msg;
}
}
&main::daemon_log("GosaPackages: $header job successfully added to job queue", 3);
- return "<xml><1>$res</1></xml>";
+ return "<xml><answer1>$res</answer1></xml>";
}
## CORE FUNCTIONS ############################################################
+sub get_where_statement {
+ my ($msg, $msg_hash)= @_;
+ my $error= 0;
+
+ my $clause_str= "";
+ if( not exists @{$msg_hash->{'where'}}[0]->{'clause'} ) { $error++; };
+ if( $error == 0 ) {
+ my @clause_l;
+ my @where = @{@{$msg_hash->{'where'}}[0]->{'clause'}};
+ foreach my $clause (@where) {
+ my $connector = $clause->{'connector'}[0];
+ if( not defined $connector ) { $connector = "AND"; }
+ $connector = uc($connector);
+ delete($clause->{'connector'});
+
+ my @phrase_l ;
+ foreach my $phrase (@{$clause->{'phrase'}}) {
+ my $operator = "=";
+ if( exists $phrase->{'operator'} ) {
+ my $op = $op_hash->{$phrase->{'operator'}[0]};
+ if( not defined $op ) {
+ &main::daemon_log("Can not translate operator '$operator' in where ".
+ "statement to sql valid syntax. Please use 'eq', ".
+ "'ne', 'ge', 'gt', 'le', 'lt' in xml message\n", 1);
+ &main::daemon_log($msg, 8);
+ $op = "=";
+ }
+ $operator = $op;
+ delete($phrase->{'operator'});
+ }
+
+ my @xml_tags = keys %{$phrase};
+ my $tag = $xml_tags[0];
+ my $val = $phrase->{$tag}[0];
+ push(@phrase_l, "$tag$operator'$val'");
+ }
+ my $clause_str .= join(" $connector ", @phrase_l);
+ push(@clause_l, $clause_str);
+ }
+
+ if( not 0 == @clause_l ) {
+ $clause_str = join(" AND ", @clause_l);
+ $clause_str = "WHERE $clause_str ";
+ }
+ }
+
+ return $clause_str;
+}
+
+sub get_select_statement {
+ my ($msg, $msg_hash)= @_;
+ my $select = "*";
+ if( exists $msg_hash->{'select'} ) {
+ my $select_l = \@{$msg_hash->{'select'}};
+ $select = join(' AND ', @{$select_l});
+ }
+ return $select;
+}
+
+
+sub get_update_statement {
+ my ($msg, $msg_hash) = @_;
+ my $error= 0;
+ my $update_str= "";
+ my @update_l;
+
+ if( not exists $msg_hash->{'update'} ) { $error++; };
+
+ if( $error == 0 ) {
+ my $update= @{$msg_hash->{'update'}}[0];
+ while( my ($tag, $val) = each %{$update} ) {
+ my $val= @{$update->{$tag}}[0];
+ push(@update_l, "$tag='$val'");
+ }
+ if( 0 == @update_l ) { $error++; };
+ }
+
+ if( $error == 0 ) {
+ $update_str= join(', ', @update_l);
+ $update_str= "SET $update_str ";
+ }
+
+ return $update_str;
+}
+
sub query_jobdb {
my ($msg) = @_;
my $msg_hash = &transform_msg2hash($msg);
# prepare query sql statement
- my @where = @{$msg_hash->{where}};
- my $where_hash = {table=>$main::job_queue_table_name };
- foreach my $where_pram (@where) {
- my $where_val = @{$msg_hash->{$where_pram}}[0];
- if (defined $where_val) {
- $where_hash->{$where_pram} = $where_val;
- }
- }
-
- # execute db query
- my $res_hash = $main::job_db->select_dbentry($where_hash);
+ my $select= &get_select_statement($msg, $msg_hash);
+ my $table= $main::job_queue_table_name;
+ my $where= &get_where_statement($msg, $msg_hash);
+ my $sql_statement= "SELECT $select FROM $table $where";
+ # execute db query
+ my $res_hash = $main::job_db->select_dbentry($sql_statement);
my $out_xml = &db_res_2_xml($res_hash);
+
return $out_xml;
}
my $msg_hash = &transform_msg2hash($msg);
# prepare query sql statement
- my @where = @{$msg_hash->{where}};
- my $where_hash = {table=>$main::job_queue_table_name };
- foreach my $where_pram (@where) {
- my $where_val = @{$msg_hash->{$where_pram}}[0];
- if (defined $where_val) {
- $where_hash->{$where_pram} = $where_val;
- }
- }
+ my $table= $main::job_queue_table_name;
+ my $where= &get_where_statement($msg, $msg_hash);
+ my $sql_statement = "DELETE FROM $table $where";
# execute db query
- my $db_res = $main::job_db->del_dbentry($where_hash);
+ my $db_res = $main::job_db->del_dbentry($sql_statement);
my $res;
if( $db_res > 0 ) {
}
+
sub clear_jobdb {
my ($msg) = @_ ;
my $msg_hash = &transform_msg2hash($msg);
+ my $error= 0;
+ my $out_xml= "<xml><answer1>1</answer1></xml>";
+
+ my $table= $main::job_queue_table_name;
- my $where_hash = {table=>$main::job_queue_table_name };
+ my $sql_statement = "DELETE FROM $table";
+ my $db_res = $main::job_db->del_dbentry($sql_statement);
+ if( not $db_res > 0 ) { $error++; };
- # execute db query
- my $db_res = $main::job_db->del_dbentry($where_hash);
- print STDERR "db_res=$db_res\n";
- my $res;
- if( $db_res eq '0E0' ) {
- $res = 0 ;
- } else {
- $res = 1;
+ if( $error == 0 ) {
+ $out_xml = "<xml><answer1>0</answer1></xml>";
}
-
- # prepare xml answer
- my $out_xml = "<xml><answer1>$res</answer1></xml>";
+
return $out_xml;
}
+
sub update_status_jobdb_entry {
my ($msg) = @_ ;
my $msg_hash = &transform_msg2hash($msg);
-
- # prepare query sql statement
- my $update_hash = {table=>$main::job_queue_table_name };
- if( exists $msg_hash->{where} ) {
- $update_hash->{where} = $msg_hash->{where};
- } else {
- $update_hash->{where} = [];
- }
-
- if( not exists $msg_hash->{update}[0]->{status} ) {
- return "<xml><answer1>1</answer1></xml>";
- }
- $update_hash->{update} = [ { status=>$msg_hash->{update}[0]->{status} } ];
+ my $error= 0;
+ my $out_xml= "<xml><answer1>1</answer1></xml>";
- # execute db query
- my $db_res = $main::job_db->update_dbentry($update_hash);
-
- # transform db answer to error returnment
- my $res;
- if( $db_res > 0 ) {
- $res = 0 ;
- } else {
- $res = 1;
- }
-
- # prepare xml answer
- my $out_xml = "<xml><answer1>$res</answer1></xml>";
- return $out_xml;
-}
-
-sub update_timestamp_jobdb_entry {
- my ($msg) = @_ ;
- my $msg_hash = &transform_msg2hash($msg);
+ my @len_hash = keys %{$msg_hash};
+ if( 0 == @len_hash) { $error++; };
# prepare query sql statement
- my $update_hash = {table=>$main::job_queue_table_name };
- if( exists $msg_hash->{where} ) {
- $update_hash->{where} = $msg_hash->{where};
- } else {
- $update_hash->{where} = [];
- }
+ if( $error == 0) {
+ my $table= $main::job_queue_table_name;
+ my $where= &get_where_statement($msg, $msg_hash);
+ my $update= &get_update_statement($msg, $msg_hash);
- if( not exists $msg_hash->{update}[0]->{timestamp} ) {
- return "<xml><answer1>1</answer1></xml>";
- }
+ my $sql_statement = "UPDATE $table $update $where";
- $update_hash->{update} = [ { timestamp=>$msg_hash->{update}[0]->{timestamp} } ];
+ # execute db query
+ my $db_res = $main::job_db->update_dbentry($sql_statement);
- # execute db query
- my $db_res = $main::job_db->update_dbentry($update_hash);
+ # check success of db update
+ if( not $db_res > 0 ) { $error++; };
+ }
- # transform db answer to error returnment
- my $res;
- if( $db_res > 0 ) {
- $res = 0 ;
- } else {
- $res = 1;
+ if( $error == 0) {
+ $out_xml = "<xml><answer1>0</answer1></xml>";
}
- # prepare xml answer
- my $out_xml = "<xml><answer1>$res</answer1></xml>";
return $out_xml;
-
}
+#sub update_timestamp_jobdb_entry {
+# my ($msg) = @_ ;
+# my $msg_hash = &transform_msg2hash($msg);
+#
+# # prepare query sql statement
+# my $update_hash = {table=>$main::job_queue_table_name };
+# if( exists $msg_hash->{where} ) {
+# $update_hash->{where} = $msg_hash->{where};
+# } else {
+# $update_hash->{where} = [];
+# }
+#
+# if( not exists $msg_hash->{update}[0]->{timestamp} ) {
+# return "<xml><answer1>1</answer1></xml>";
+# }
+#
+# $update_hash->{update} = [ { timestamp=>$msg_hash->{update}[0]->{timestamp} } ];
+#
+# # execute db query
+# my $db_res = $main::job_db->update_dbentry($update_hash);
+#
+# # transform db answer to error returnment
+# my $res;
+# if( $db_res > 0 ) {
+# $res = 0 ;
+# } else {
+# $res = 1;
+# }
+#
+# # prepare xml answer
+# my $out_xml = "<xml><answer1>$res</answer1></xml>";
+# return $out_xml;
+#
+#}
+
1;
index cf26ca49fc88e24b5b22e622bea255cd86e33585..62e2a3caa29084e69fd3af8f81c733bc1d76c0cf 100644 (file)
# xml tags without a content are created as an empty hash
# substitute it with an empty list
- while( my ($xml_tag, $xml_content) = each %{ $hash } ) {
- if( 1 == @{ $xml_content } ) {
- # there is only one element in xml_content list ...
- my $element = @{ $xml_content }[0];
- if( ref($element) eq "HASH" ) {
- # and this element is an hash ...
- my $len_element = keys %{ $element };
- if( $len_element == 0 ) {
- # and this hash is empty, then substitute the xml_content
- # with an empty string in list
- $hash->{$xml_tag} = [ "none" ];
+ eval {
+ while( my ($xml_tag, $xml_content) = each %{ $hash } ) {
+ if( 1 == @{ $xml_content } ) {
+ # there is only one element in xml_content list ...
+ my $element = @{ $xml_content }[0];
+ if( ref($element) eq "HASH" ) {
+ # and this element is an hash ...
+ my $len_element = keys %{ $element };
+ if( $len_element == 0 ) {
+ # and this hash is empty, then substitute the xml_content
+ # with an empty string in list
+ $hash->{$xml_tag} = [ "none" ];
+ }
}
}
}
+ };
+ if( $@ ) {
+ $hash = undef;
}
return $hash;
index cb7c976f95d75ca3a8d34a9fe36ce37c891d6f4d..80ce0ada7ea9b34d085b9bdf44aece6257816bdd 100644 (file)
# check wether incoming msg is from a known_server
if( not defined $msg ) {
- my $query_res = $main::known_server_db->select_dbentry( {table=>'known_server'} );
+ #my $query_res = $main::known_server_db->select_dbentry( {table=>'known_server'} );
+ my $sql_statement= "SELECT * FROM known_server";
+ my $query_res = $main::known_server_db->select_dbentry( $sql_statement );
while( my ($hit_num, $hit) = each %{ $query_res } ) {
$host_name = $hit->{hostname};
if( not $host_name =~ "^$host") {
# check wether incoming msg is from a known_client
if( not defined $msg ) {
- my $query_res = $main::known_clients_db->select_dbentry( {table=>'known_clients'} );
+ #my $query_res = $main::known_clients_db->select_dbentry( {table=>'known_clients'} );
+ my $sql_statement= "SELECT * FROM known_clients";
+ my $query_res = $main::known_clients_db->select_dbentry( $sql_statement );
while( my ($hit_num, $hit) = each %{ $query_res } ) {
$host_name = $hit->{hostname};
if( not $host_name =~ "^$host") {
index a673db58c14eb1dbe62322f6e774a0914d8cf680..f095d31a1d79ef1d1a1163bd05fc1362b40ea3d3 100755 (executable)
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
# add
#$data = "<xml><header>gosa_ping</header><source>10.89.1.155:20082</source><target>10.89.1.155:20080</target></xml>";
-# $data = "<xml> <header>job_ping</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>19700101000000</timestamp> </xml>";
-# $data = "<xml> <header>job_sayHello</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>20130102133900</timestamp> </xml>";
-# $data = "<xml> <header>job_ping</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>20130102133900</timestamp> </xml>";
+#$data = "<xml> <header>job_ping</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>19700101000000</timestamp> </xml>";
+#$data = "<xml> <header>job_sayHello</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>20130102133900</timestamp> </xml>";
+$data = "<xml> <header>job_ping</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>20130102133900</timestamp> </xml>";
# delete
- #$data = "<xml> <header>gosa_delete_jobdb_entry</header> <where>headertag</where> <headertag>sayHello</headertag> </xml>";
+#$data = "<xml> <header>gosa_delete_jobdb_entry</header><where><clause><phrase><status>error</status></phrase></clause></where></xml>";
# update
- #$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <where> <status>waiting</status> </where> <update> <status>processing</status> </update></xml>";
- #$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <update> <status>waiting</status> </update></xml>";
- #$data = "<xml> <header>gosa_update_timestamp_jobdb_entry</header> <update> <timestamp>20130123456789</timestamp> </update></xml>";
+#$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <where><clause><phrase> <status>waiting</status></phrase></clause> </where> <update><status>processing</status> <result>update</result></update></xml>";
# query
-$data = "<xml><header>gosa_query_jobdb</header><where>status</where><status>error</status></xml>";
+#$data = "<xml><header>gosa_query_jobdb</header><where><clause><connector>and</connector><phrase><operator>gt</operator><id>2</id></phrase><phrase><operator>le</operator><id>4</id></phrase></clause></where></xml>";
+#$data= "<xml><header>gosa_query_jobdb</header><where><clause><phrase><status>waiting</status></phrase></clause></where></xml>";
+
# clear
- #$data = "<xml> <header>gosa_clear_jobdb</header> </xml>";
+#$data = "<xml> <header>gosa_clear_jobdb</header> </xml>";
$sock->write($data);
$answer = "nothing";