index 25127ad060f78c3692a1daa8a381705f46f02e8c..f03074b18c8fe398cf610294445317ab981cd73c 100644 (file)
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";
"</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 {
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");
}
}
if( $error == 0 ) {
# add job to job queue
my $func_dic = {table=>$main::job_queue_tn,
- primkey=>['id'],
+ primkey=>[],
timestamp=>$timestamp,
status=>'waiting',
result=>'none',
targettag=>$target,
xmlmessage=>$msg,
macaddress=>$macaddress,
+ plainname=>$plain_name,
};
-
my $res = $main::job_db->add_dbentry($func_dic);
if (not $res == 0) {
&main::daemon_log("$session_id ERROR: GosaPackages: process_job_msg: $res", 1);