Code

Fixed repository service
[gosa.git] / gosa-si / server / events / clMessages.pm
index a6fad7e3dd9f17268a07ebb7d4cd69a2803a70ff..b566687623c15df941f43bdb860b2ef32c996481 100644 (file)
@@ -2,6 +2,7 @@ package clMessages;
 use Exporter;
 @ISA = qw(Exporter);
 my @events = (
+    "confirm_usr_msg",
     "PROGRESS",
     "FAIREBOOT",
     "TASKSKIP",
@@ -51,6 +52,23 @@ sub get_events {
 }
 
 
+sub confirm_usr_msg {
+    my ($msg, $msg_hash, $session_id) = @_;
+    my $message = @{$msg_hash->{'message'}}[0];
+    my $subject = @{$msg_hash->{'subject'}}[0];
+    my $usr = @{$msg_hash->{'usr'}}[0];
+
+    # set update for this message
+    my $sql = "UPDATE $main::messaging_tn SET flag='s' WHERE (message='$message' AND subject='$subject' AND message_to='$usr')"; 
+    &main::daemon_log("$session_id DEBUG: $sql", 7);
+    my $res = $main::messaging_db->exec_statement($sql); 
+
+
+    return;
+}
+
+
+
 sub read_configfile {
     my ($cfg_file, %cfg_defaults) = @_;
     my $cfg;
@@ -354,10 +372,13 @@ sub TASKBEGIN {
                                }
                        }
                
-                       # in case of no and more than one running jobs in queue, add on single job
+                       # in case of no and more than one running jobs in queue, add one single job
+
+# TODO
+                       # resolve plain name for host $macaddress
                        &main::daemon_log("$session_id DEBUG: add job to queue for host '$macaddress'", 7); 
                        my $func_dic = {table=>$main::job_queue_tn,
-                                       primkey=>['id'],
+                                       primkey=>[],
                                        timestamp=>&get_time,
                                        status=>'processing',
                                        result=>"$header $content",
@@ -366,7 +387,7 @@ sub TASKBEGIN {
                                        targettag=>$source,
                                        xmlmessage=>'none',
                                        macaddress=>$macaddress,
-                                       plain_name=>'none',
+                                       plainname=>'none',
                        };
                        my ($err, $error_str) = $main::job_db->add_dbentry($func_dic);
                        if ($err != 0)  {