From 3433308926cbcc1710da43fc7ca7a19f48d39858 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 23 Nov 2007 09:56:32 +0000 Subject: [PATCH] Closes #275 Added timezone to logging. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7866 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/addons/logview/class_gosa_logview.inc | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/plugins/addons/logview/class_gosa_logview.inc b/plugins/addons/logview/class_gosa_logview.inc index e538cb0be..5f1513ae2 100644 --- a/plugins/addons/logview/class_gosa_logview.inc +++ b/plugins/addons/logview/class_gosa_logview.inc @@ -23,6 +23,7 @@ class gosa_logview extends plugin var $range = 25; var $view_logged = FALSE; + var $timezone_offset = 0; function gosa_logview (&$config, $dn= NULL) { @@ -36,6 +37,9 @@ class gosa_logview extends plugin $this->$attr = $_SESSION['logview']['gosa_log'][$attr]; } } + + $tz = get_default_timezone(); + $this->timezone_offset = $tz['value'] * 60 * 60 ; } @@ -57,15 +61,17 @@ class gosa_logview extends plugin "4" => _("2 days"), "5" => _("one week"), "6" => _("2 weeks"), "7" => _("one month")); + + $time = time(); $date_select_ = array( - "0" => time() - 3600, - "1" => time() - 21600, - "2" => time() - 43200, - "3" => time() - 86400, - "4" => time() - 172800, - "5" => time() - 604800, - "6" => time() - 1209600, - "7" => time() - 2419200); + "0" => $time - 3600, + "1" => $time - 21600, + "2" => $time - 43200, + "3" => $time - 86400, + "4" => $time - 172800, + "5" => $time - 604800, + "6" => $time - 1209600, + "7" => $time - 2419200); $smarty= get_smarty(); $smarty->assign("search_result", ""); @@ -204,7 +210,7 @@ class gosa_logview extends plugin $desc= ""; $sort_sign="/\\"; } - $end= date ("YmdHis"); + $end= date ("YmdHis",time()); $query_base= " FROM gosa_log WHERE @@ -263,7 +269,7 @@ class gosa_logview extends plugin $res.=" \n"; $res.=" ".$line['action'].""; - $res.=" ".date("H:i:s d.m.Y",$line['timestamp']).""; + $res.=" ".date("H:i:s d.m.Y",($line['timestamp'] + $this->timezone_offset)).""; $res.=" ".preg_replace("/,/",", ",$user).""; $res.=" ".$line['objecttype'].""; $res.=" ".preg_replace("/,/",", ",$object).""; -- 2.30.2