summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 92be33b)
raw | patch | inline | side by side (parent: 92be33b)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 3 Nov 2008 15:30:36 +0000 (15:30 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 3 Nov 2008 15:30:36 +0000 (15:30 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12878 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/modules/GosaSupportDaemon.pm | patch | blob | history |
index fb6fc7039bf1d1dcd1840b97963a0082d0bd5296..f732b34859c0ba7ccdf9c317b1182c8e667a836d 100644 (file)
"create_xml_string",
"transform_msg2hash",
"get_time",
+ "get_utc_time",
"build_msg",
"db_res2xml",
"db_res2si_msg",
"read_configfile",
"check_opsi_res",
"calc_timestamp",
+ "opsi_callobj2string",
);
@EXPORT = @functions;
use strict;
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;
}
+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
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;