Code

like operator for db queries, closes 392
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 7 Apr 2008 08:10:41 +0000 (08:10 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 7 Apr 2008 08:10:41 +0000 (08:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10220 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/modules/GosaSupportDaemon.pm
gosa-si/tests/client.php

index de26b59b58b6b0cc279294b907a74ac3b4f2f754..fe027fe173ff61e95ad0b95d0287839e65dd0f26 100644 (file)
@@ -36,6 +36,7 @@ my $op_hash = {
     'gt' => '>',
     'le' => '<=',
     'lt' => '<',
+    'like' => ' LIKE ',
 };
 
 
@@ -249,7 +250,7 @@ sub get_where_statement {
                 if( exists $phrase->{'operator'} ) {
                     my $op = $op_hash->{$phrase->{'operator'}[0]};
                     if( not defined $op ) {
-                        &main::daemon_log("ERROR: Can not translate operator '$operator' in where ".
+                        &main::daemon_log("ERROR: 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);
index e3d7a1d7dca78d8dfc274e4a4ea777b7dbf0f2a7..07b6af72c468f0881a895078277eac393c43ff57 100755 (executable)
@@ -17,7 +17,7 @@ if($sock->connected()){
 
 # jobdb add
 #$data = "<xml> <header>gosa_network_completition</header> <source>GOSA</source><target>GOSA</target><hostname>ws-muc-2</hostname></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_sayHello</header> <source>10.89.1.155:20083</source><target>00:01:6c:9d:b9:fa</target><mac>00:1B:77:04:8A:6C</mac> <timestamp>20130102133900</timestamp> </xml>";
 #$data = "<xml> <header>job_ping</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <macaddress>00:01:6c:9d:b9:fa</macaddress><timestamp>19700101000000</timestamp> </xml>";
 
 
@@ -36,6 +36,7 @@ if($sock->connected()){
 
 # jobdb query
 #$data = "<xml><header>gosa_query_jobdb</header><source>GOSA</source> <target>GOSA</target><where><clause><connector>and</connector><phrase><operator>gt</operator><ROWID>0</ROWID></phrase><phrase><operator>le</operator><ROWID>5</ROWID></phrase></clause></where></xml>";
+#$data = "<xml><header>gosa_query_jobdb</header><source>GOSA</source> <target>GOSA</target> <where> <clause> <phrase> <operator>like</operator> <timestamp>%0102%</timestamp> </phrase> </clause> </where> </xml>";
 #$data= "<xml><header>gosa_query_jobdb</header><source>GOSA</source> <target>GOSA</target><where><clause><phrase><headertag>ping</headertag></phrase></clause></where><limit><from>0</from><to>3</to></limit></xml>";
 #$data= "<xml><header>gosa_query_jobdb</header><source>GOSA</source> <target>GOSA</target><where><clause><phrase><HEADERTAG>trigger_action_reinstall</HEADERTAG></phrase></clause></where><limit><from>0</from><to>25</to></limit><orderby>timestamp DESC</orderby></xml>";
 #$data= "<xml><header>gosa_query_jobdb</header><source>GOSA</source> <target>GOSA</target></xml>";
@@ -80,7 +81,7 @@ if($sock->connected()){
 
 ################
 # logHandling.pm
-$data = "<xml> <header>gosa_show_log_by_mac</header> <target>GOSA</target> <source>GOSA</source> <mac>00:01:6c:9d:b9:fa</mac> </xml>"; 
+#$data = "<xml> <header>gosa_show_log_by_mac</header> <target>GOSA</target> <source>GOSA</source> <mac>00:01:6c:9d:b9:fa</mac> </xml>";