use getTimeZone()

This commit is contained in:
Roland Gruber 2015-11-07 08:30:52 +00:00
parent da7e667100
commit 96ae5f85e2
3 changed files with 5 additions and 6 deletions

View File

@ -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);
}

View File

@ -553,16 +553,16 @@ class shadowAccount extends baseModule implements passwordService {
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
*/
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);

View File

@ -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');
}
}