diff --git a/lam/lib/account.inc b/lam/lib/account.inc index ee495cac..7644a142 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -1283,8 +1283,7 @@ function getCallingURL() { * @return int offset */ function getTimeZoneOffsetHours() { - $timeZone = $_SESSION['config']->getTimeZone(); - $dtz = new DateTimeZone($timeZone); + $dtz = getTimeZone(); return round($dtz->getOffset(new DateTime('UTC')) / 3600); } diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index 7d79b050..47ec099a 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -553,16 +553,16 @@ class shadowAccount extends baseModule implements passwordService { * @return list of PDF entries (array( => )) */ function get_pdfEntries($pdfKeys) { - $timeZone = new DateTimeZone($_SESSION['config']->getTimeZone()); + $timeZone = getTimeZone(); $shadowLastChange = ''; if (!empty($this->attributes['shadowLastChange'][0])) { $time = new DateTime('@' . $this->attributes['shadowLastChange'][0]*24*3600, $timeZone); - $shadowLastChange = $time->format('d. m. Y'); + $shadowLastChange = $time->format('d.m.Y'); } $shadowExpire = ''; if (!empty($this->attributes['shadowExpire'][0])) { $time = new DateTime('@' . $this->attributes['shadowExpire'][0]*24*3600); - $shadowExpire = $time->format('d. m. Y'); + $shadowExpire = $time->format('d.m.Y'); } $return = array(); $this->addPDFKeyValue($return, 'shadowLastChange', _('Last password change'), $shadowLastChange); diff --git a/lam/lib/types/user.inc b/lam/lib/types/user.inc index cf14bcb2..9d09f9b8 100644 --- a/lam/lib/types/user.inc +++ b/lam/lib/types/user.inc @@ -647,7 +647,7 @@ class lamUserList extends lamList { // expire dates elseif ($attribute == 'shadowexpire') { if (!empty($entry[$attribute][0])) { - $time = new DateTime('@' . $entry[$attribute][0] * 24 * 3600, new DateTimeZone($_SESSION['config']->getTimeZone())); + $time = new DateTime('@' . $entry[$attribute][0] * 24 * 3600, getTimeZone()); echo $time->format('d.m.Y'); } }