From: rettenbe Date: Mon, 3 Nov 2008 15:30:36 +0000 (+0000) Subject: delete not needed offset option within get_time() X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f1e1f0ce3bdbbb31337857badb4ab3ea88949439;p=gosa.git delete not needed offset option within get_time() git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12878 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index fb6fc7039..f732b3485 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -10,6 +10,7 @@ my @functions = ( "create_xml_string", "transform_msg2hash", "get_time", + "get_utc_time", "build_msg", "db_res2xml", "db_res2si_msg", @@ -34,6 +35,7 @@ my @functions = ( "read_configfile", "check_opsi_res", "calc_timestamp", + "opsi_callobj2string", ); @EXPORT = @functions; use strict; @@ -180,10 +182,8 @@ sub add_content2xml_hash { sub get_time { - # Add an optional offset in seconds - my $offset = $1 if shift =~ /^(\d+)$/ || 0; my ($seconds, $minutes, $hours, $monthday, $month, - $year, $weekday, $yearday, $sommertime) = localtime(time+$offset); + $year, $weekday, $yearday, $sommertime) = localtime; $hours = $hours < 10 ? $hours = "0".$hours : $hours; $minutes = $minutes < 10 ? $minutes = "0".$minutes : $minutes; $seconds = $seconds < 10 ? $seconds = "0".$seconds : $seconds; @@ -195,6 +195,12 @@ sub get_time { } +sub get_utc_time { + my $utc_time = qx(date --utc +%Y%m%d%H%M%S); + $utc_time =~ s/\s$//; + return $utc_time; +} + #=== FUNCTION ================================================================ # NAME: build_msg @@ -856,5 +862,18 @@ sub calc_timestamp { return $res_timestamp; } - +sub opsi_callobj2string { + my ($callobj) = @_; + my @callobj_string; + while(my ($key, $value) = each(%$callobj)) { + my $value_string = ""; + if (ref($value) eq "ARRAY") { + $value_string = join(",", @$value); + } else { + $value_string = $value; + } + push(@callobj_string, "$key=$value_string") + } + return join(", ", @callobj_string); +} 1;