From: rettenbe Date: Thu, 11 Sep 2008 13:39:29 +0000 (+0000) Subject: update: mailqueue_query at mailqueue.pm accepts a regex as q_value X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8f5275323d79854459fdb34fc20d3afeca4fd8b6;p=gosa.git update: mailqueue_query at mailqueue.pm accepts a regex as q_value git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12427 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/client/events/mailqueue.pm b/gosa-si/client/events/mailqueue.pm index 2521be247..76c92e2f6 100644 --- a/gosa-si/client/events/mailqueue.pm +++ b/gosa-si/client/events/mailqueue.pm @@ -170,7 +170,9 @@ sub mailqueue_query { &main::daemon_log("$session_id DEBUG: \n$msg", 9); $query_positiv++; } else { - if ($act_result->{'msg_id'} eq $q_value) { $query_positiv++; } + if ( &_exec_op($act_result->{'msg_id'}, $q_operator, $q_value) ) { + $query_positiv++; + } } # Query for message size @@ -198,7 +200,9 @@ sub mailqueue_query { &main::daemon_log("$session_id DEBUG: \n$msg", 9); $query_positiv++; } else { - if ($act_result->{'sender'} eq $q_value) { $query_positiv++; } + if ( &_exec_op($act_result->{'sender'}, $q_operator, $q_value)) { + $query_positiv++; + } } # Query for recipient @@ -209,7 +213,9 @@ sub mailqueue_query { &main::daemon_log("$session_id DEBUG: \n$msg", 9); $query_positiv++; } else { - if ($act_result->{'recipient'} eq $q_value) { $query_positiv++; } + if ( &_exec_op($act_result->{'recipient'}, $q_operator, $q_value)) { + $query_positiv++; + } } } } @@ -684,7 +690,7 @@ sub _exec_op { my $res; if ($op eq "eq") { - $res = $a == $b ? 1 : 0 ; + $res = $a =~ /$b/ ? 1 : 0 ; } elsif ($op eq "gt") { $res = $a > $b ? 1 : 0 ; } elsif ($op eq "lt") { diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index cb8f19025..81cfbc383 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -185,7 +185,7 @@ for($count = 1; $count <= $zahl; $count++) # Querying the mailqueue at #$data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:aa:16
"; - $data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:b9:fa arrival_time gt 20080812120000
"; + $data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:b9:fa recipient eq rett
"; # Multiple xml tags msg_id are allowed #$data = "
gosa_mailqueue_hold
GOSA 00:01:6c:9d:b9:fa 99C8ABEF23
";