X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-si%2Fmodules%2FGosaSupportDaemon.pm;h=b3a43167718f6a03a631abf084648b2af918c64e;hb=c7c87bf20a909ed7ff997aa879cd9146e74316af;hp=526afd36c146285bf6738cf59da4d31fec0813ae;hpb=f5f04a5521a10b4d41fd64b5029805c197d9d2fc;p=gosa.git diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index 526afd36c..b3a431677 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -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(''); }