X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-si%2Fmodules%2FGosaSupportDaemon.pm;h=b3a43167718f6a03a631abf084648b2af918c64e;hb=c7c87bf20a909ed7ff997aa879cd9146e74316af;hp=9b156820c668603b9f14062caa752249ee32c4b2;hpb=d88621a8e07b969b9d214262eae3b5b6c570180b;p=gosa.git diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index 9b156820c..b3a431677 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -528,7 +528,7 @@ sub import_events { # Check config file to exclude disabled event plugins (i.e. Opsi) if ($event eq "opsi_com.pm" && $main::opsi_enabled ne "true") { - &main::daemon_log("WARNING: opsi-module is installed but not enabled in config file, please set under section '[OPSI]': 'enabled=true'", 3); + &main::daemon_log("0 WARNING: opsi-module is installed but not enabled in config file, please set under section '[OPSI]': 'enabled=true'", 3); next; } @@ -758,9 +758,11 @@ sub run_as { } my $cmd_line= "$sudo_cmd su - $uid -c '$command'"; open(PIPE, "$cmd_line |"); - my $result = {'resultCode' => $?}; - $result->{'command'} = $cmd_line; + my $result = {'command' => $cmd_line}; push @{$result->{'output'}}, ; + close(PIPE); + my $exit_value = $? >> 8; + $result->{'resultCode'} = $exit_value; return $result; } @@ -840,7 +842,8 @@ sub check_opsi_res { } sub calc_timestamp { - my ($timestamp, $operation, $value) = @_ ; + my ($timestamp, $operation, $value, $entity) = @_ ; + $entity = defined $entity ? $entity : "seconds"; my $res_timestamp = 0; $value = int($value); @@ -855,12 +858,12 @@ sub calc_timestamp { ); if ($operation eq "plus" || $operation eq "+") { - $dt->add( seconds => $value); + $dt->add($entity => $value); $res_timestamp = $dt->ymd('').$dt->hms(''); } if ($operation eq "minus" || $operation eq "-") { - $dt->subtract(seconds => $value); + $dt->subtract($entity => $value); $res_timestamp = $dt->ymd('').$dt->hms(''); }