Code

new column for jobs.db
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Apr 2008 12:13:45 +0000 (12:13 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Apr 2008 12:13:45 +0000 (12:13 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10356 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server
gosa-si/modules/GosaPackages.pm

index 5ee945afe0e9cf7af2abbedaef1f1339cbec1171..cb243deff3879981da39f477314cdf26463fae52 100755 (executable)
@@ -124,6 +124,7 @@ my @job_queue_col_names = ("id INTEGER",
                "targettag DEFAULT 'none'", 
                "xmlmessage DEFAULT 'none'", 
                "macaddress DEFAULT 'none'",
+               "plainname DEFAULT 'none'",
                );
 
 # holds all other gosa-sd as well as the gosa-sd-bus
index 25127ad060f78c3692a1daa8a381705f46f02e8c..1141a1d59822ab2eaa3b8a1f3dc6640d0a6d0b05 100644 (file)
@@ -324,6 +324,7 @@ sub process_job_msg {
 
     my $header = @{$msg_hash->{'header'}}[0];
     $header =~ s/job_//;
+       my $target = @{$msg_hash->{'target'}}[0];
     
     # if no timestamp is specified, use 19700101000000
     my $timestamp = "19700101000000";
@@ -348,12 +349,12 @@ sub process_job_msg {
             "</xml>";
     }
     
-       # if mac address is already known in ldap, set targettag to 'cn'
-    my $target;
+       # if mac address is already known in ldap, set plain_name to 'cn'
+    my $plain_name;
        my $ldap_handle = &main::get_ldap_handle($session_id); 
        if( not defined $ldap_handle ) {
                &main::daemon_log("$session_id ERROR: cannot connect to ldap", 1);
-               $target = "none"; 
+               $plain_name = "none"; 
                
        # try to fetch a 'real name'            
        } else {
@@ -364,10 +365,10 @@ sub process_job_msg {
                                                filter => "(macAddress=$macaddress)");
                if($mesg->code) {
                        &main::daemon_log($mesg->error, 1);
-                       $target = "none";
+                       $plain_name = "none";
                } else {
                        my $entry= $mesg->entry(0);
-                       $target = $entry->get_value("cn");
+                       $plain_name = $entry->get_value("cn");
                }
        }
 
@@ -383,6 +384,7 @@ sub process_job_msg {
             targettag=>$target,
             xmlmessage=>$msg,
             macaddress=>$macaddress,
+                       plainname=>$plain_name,
         };
 
         my $res = $main::job_db->add_dbentry($func_dic);