From 7bcc8f543975b2bea2269fa4af2aba7baf5bb82d Mon Sep 17 00:00:00 2001 From: ullgren Date: Thu, 14 Feb 2002 21:57:19 +0000 Subject: [PATCH] Added userspace configurable timezone git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2447 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/load_prefs.php | 3 +++ src/options_personal.php | 22 ++++++++++++++++++++++ src/validate.php | 6 +++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/load_prefs.php b/src/load_prefs.php index a7b539dd..cce03543 100644 --- a/src/load_prefs.php +++ b/src/load_prefs.php @@ -132,6 +132,9 @@ $editor_size = getPref($data_dir, $username, 'editor_size', 76 ); $use_signature = getPref($data_dir, $username, 'use_signature', SMPREF_OFF ); $prefix_sig = getPref($data_dir, $username, 'prefix_sig'); +/* Load timezone preferences */ +$timezone = getPref($data_dir, $username, 'timezone', SMPREF_NONE ); + /* Load preferences for reply citation style. */ $reply_citation_style = diff --git a/src/options_personal.php b/src/options_personal.php index 1e1614c5..a2250a46 100644 --- a/src/options_personal.php +++ b/src/options_personal.php @@ -112,6 +112,28 @@ function load_optpage_data_personal() { ); } + $TZ_ARRAY[SMPREF_NONE] = _("Same as server"); + $fd = fopen('../locale/timezones.cfg','r'); + while (!feof ($fd)) { + $zone = fgets($fd, 1024); + if( $zone ) { + $zone = trim($zone); + $TZ_ARRAY["$zone"] = "$zone"; + } + } + fclose ($fd); + + $optgrps[SMOPT_GRP_TZ] = _("Timezone Options"); + $optvals[SMOPT_GRP_TZ] = array(); + + $optvals[SMOPT_GRP_TZ][] = array( + 'name' => 'timezone', + 'caption' => _("Your current timezone"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $TZ_ARRAY + ); + /*** Load the Reply Citation Options into the array ***/ $optgrps[SMOPT_GRP_REPLY] = _("Reply Citation Options"); $optvals[SMOPT_GRP_REPLY] = array(); diff --git a/src/validate.php b/src/validate.php index 2d6fc3d5..60af3509 100644 --- a/src/validate.php +++ b/src/validate.php @@ -70,4 +70,8 @@ require_once('../functions/prefs.php'); global $username, $data_dir; set_up_language(getPref($data_dir, $username, 'language')); -?> \ No newline at end of file +$timeZone = getPref($data_dir, $username, 'timezone'); +if ( $timeZone ) { + putenv("TZ=".$timeZone); +} +?> -- 2.25.1