Project

General

Profile

« Previous | Next » 

Revision ecaca752

Added by Renato Botelho almost 10 years ago

Try to use default timezone from globals.inc when possible. Stop setting timezone on pkg_mgr_installed.php

View differences:

src/etc/inc/config.gui.inc
80 80
$config = parse_config();
81 81

  
82 82
/* set timezone */
83
$timezone = $config['system']['timezone'];
84
if (!$timezone) {
83
if (isset($config['system']['timezone']) &&
84
    !empty($config['system']['timezone'])) {
85
	$timezone = $config['system']['timezone'];
86
} elseif (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
87
	$timezone = $g['default_timezone'];
88
} else {
85 89
	$timezone = "Etc/UTC";
86 90
}
87 91
date_default_timezone_set("$timezone");
src/etc/inc/config.inc
210 210
$config = parse_config();
211 211

  
212 212
/* set timezone */
213
$timezone = $config['system']['timezone'];
214
if (!$timezone) {
213
if (isset($config['system']['timezone']) &&
214
    !empty($config['system']['timezone'])) {
215
	$timezone = $config['system']['timezone'];
216
} elseif (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
217
	$timezone = $g['default_timezone'];
218
} else {
215 219
	$timezone = "Etc/UTC";
216 220
}
217 221
date_default_timezone_set("$timezone");
src/usr/local/www/guiconfig.inc
1231 1231
<?php
1232 1232
}
1233 1233

  
1234
$timezone = $config['system']['timezone'];
1235
if (!$timezone) {
1234
/* set timezone */
1235
if (isset($config['system']['timezone']) &&
1236
    !empty($config['system']['timezone'])) {
1237
	$timezone = $config['system']['timezone'];
1238
} elseif (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
1239
	$timezone = $g['default_timezone'];
1240
} else {
1236 1241
	$timezone = "Etc/UTC";
1237 1242
}
1238 1243

  
src/usr/local/www/pkg_mgr_installed.php
66 66
require_once("guiconfig.inc");
67 67
require_once("pkg-utils.inc");
68 68

  
69
$timezone = $config['system']['timezone'];
70
if (!$timezone) {
71
	$timezone = "Etc/UTC";
72
}
73

  
74
date_default_timezone_set($timezone);
75

  
76 69
/* if upgrade in progress, alert user */
77 70
if (is_subsystem_dirty('packagelock')) {
78 71
	$pgtitle = array(gettext("System"), gettext("Package Manager"));
src/usr/local/www/system.php
96 96
	$pconfig['timeupdateinterval'] = 300;
97 97
}
98 98
if (!$pconfig['timezone']) {
99
	$pconfig['timezone'] = "Etc/UTC";
99
	if (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
100
		$pconfig['timezone'] = $g['default_timezone'];
101
	} else {
102
		$pconfig['timezone'] = "Etc/UTC";
103
	}
100 104
}
105

  
101 106
if (!$pconfig['timeservers']) {
102 107
	$pconfig['timeservers'] = "pool.ntp.org";
103 108
}

Also available in: Unified diff