#108 Timezone Reverts to GMT (Win32)

open
nobody
None
5
2006-02-19
2005-04-05
Adam Pavelec
No

Environment:

Apache/1.3.33 (Win32) PHP/4.3.9
hMailServer
SM 1.4.4 & 1.5.0
config.php using "$imap_server_type = 'hmailserver';"
directive.

Issue:

Changing the timezone in Options > Personal Information
to anything other than "Same as server" displays the
clock in GMT. It also makes Apache log with timestamps
in GMT.

Steps to reproduce:

First off, make sure Apache's logs contain the correct
timestamp. In my case, they should be
[DAY/MONTH/YEAR:hh:mm:ss -0400]. Then go into SM and
change your timezone to anything other than "Same as
server". Now, refresh your folder list. The clock will
now be displayed in GMT. Go back into Apache's logs and
see if the offset has changed. If so, the only way I've
found to get it back to normal is to restart Apache. It
seems that changing "Same as server" to anything else
in SM casues this to occur.

Discussion

  • Logged In: YES
    user_id=285765

    This looks very much like #1078202. It appears to me that
    changing that setting in SquirrelMail causes the timezone in
    the Windows operating system itself gets changed... can you
    verify that that is indeed the case?

     
  • Adam Pavelec
    Adam Pavelec
    2005-04-05

    Logged In: YES
    user_id=814392

    My apologies -- I searched for this, but apparently not
    thoroughly enough. Yes, it looks very much like #1078202.
    However, from what I can tell so far, the OS' TZ remains
    intact. Both before and after changing from "Same as
    server" to something else, I get "Z:\TEMP>settz 0
    Timezone is currently set to Eastern Daylight Time."

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-04-05

    Logged In: YES
    user_id=225877

    Can you replace existing locale/timezones.cfg file with the
    one that is attached to this tracker and check if it starts
    working correctly.

    Attached timezones.cfg file contains only timezone codes. It
    is not user friendly. You can find country <-> timezone
    mappings at

    http://www.steltor.com/notes/corptime-server/5_3/refmanual/refappd.htm

    or

    http://docs.sun.com/source/816-5523-10/appf.htm

    quick tests with WinXP Pro IIS5 show that attached file
    works correctly with some countries but it might have
    incorrect offset for Armenia.

    I haven't found listing of timezones supported by Windows on
    MSDN. If you can find page that clearly states that provided
    information can be used without any license restrictions,
    can you put URL to it on this tracker. Thanks.

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-04-05

     
    Attachments
  • Adam Pavelec
    Adam Pavelec
    2005-04-05

    Logged In: YES
    user_id=814392

    Interesting. The clock seems to display the correct time
    zone with the new timezone.cfg, however, Apache's timestamps
    are still being changed whenever the timezone is changed in
    SM. Is this to be expected?

    192.168.39.32 - - [05/Apr/2005:10:48:15 -0500] "POST
    /squirrelmail/src/redirect.php HTTP/1.1" 302 5
    192.168.39.32 - - [05/Apr/2005:10:48:15 -0500] "GET
    /squirrelmail/src/webmail.php HTTP/1.1" 200 342
    192.168.39.32 - - [05/Apr/2005:10:48:15 -0500] "GET
    /squirrelmail/src/left_main.php HTTP/1.1" 200 2187
    192.168.39.32 - - [05/Apr/2005:10:48:15 -0500] "GET
    /squirrelmail/src/options.php?optpage=personal&askinfo=yes
    HTTP/1.1" 200 9676
    192.168.39.32 - - [05/Apr/2005:10:48:22 -0500] "GET
    /squirrelmail/src/left_main.php HTTP/1.1" 200 2187
    192.168.39.32 - - [05/Apr/2005:10:48:32 -0500] "POST
    /squirrelmail/src/options.php HTTP/1.1" 200 7262
    192.168.39.32 - - [05/Apr/2005:10:48:33 -0500] "GET
    /squirrelmail/src/left_main.php HTTP/1.1" 200 2187
    192.168.39.32 - - [05/Apr/2005:10:48:45 -0500] "GET
    /squirrelmail/src/options.php?optpage=personal HTTP/1.1" 200
    9546
    192.168.39.32 - - [05/Apr/2005:10:49:07 -0500] "POST
    /squirrelmail/src/options.php HTTP/1.1" 200 7262
    192.168.39.32 - - [05/Apr/2005:09:49:09 -0600] "GET
    /squirrelmail/src/left_main.php HTTP/1.1" 200 2186
    192.168.39.32 - - [05/Apr/2005:09:49:19 -0600] "GET
    /squirrelmail/src/left_main.php HTTP/1.1" 200 2186
    192.168.39.32 - - [05/Apr/2005:09:49:20 -0600] "GET
    /squirrelmail/src/options.php?optpage=personal HTTP/1.1" 200
    9546
    192.168.39.32 - - [05/Apr/2005:09:49:28 -0600] "POST
    /squirrelmail/src/options.php HTTP/1.1" 200 7262
    192.168.39.32 - - [05/Apr/2005:08:49:29 -0700] "GET
    /squirrelmail/src/left_main.php HTTP/1.1" 200 2186
    192.168.39.32 - - [05/Apr/2005:08:50:29 -0700] "GET
    /squirrelmail/src/left_main.php HTTP/1.1" 200 2186
    192.168.39.32 - - [05/Apr/2005:08:50:30 -0700] "GET
    /squirrelmail/themes/css/verdana-10.css HTTP/1.1" 200 245

     
  • Adam Pavelec
    Adam Pavelec
    2005-04-05

    Logged In: YES
    user_id=814392

    Also, when I change it back to "Same as server", it remains
    in the last selected TZ.

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-04-05

     
    Attachments
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-04-05

    Logged In: YES
    user_id=225877

    i think logging problem might be related to php or apache.
    Any script running as unpriviled user can change timezone
    settings in current environment. These changes should not
    affect time format used webserver logging system.

    Or we have to unset tz environment variable in all scripts
    that are accessed directly.

    If attached tztest.php script outputs date in GMT+0300 and
    server logs it as GMT+0100, consider putting appropriate
    putenv calls in script that is loaded with php
    auto_append_file setting. check if you can reproduce it with
    latest php and apache versions and report problem to
    apache/php developers.

    From http://www.php.net/putenv
    "Adds setting to the server environment. The environment
    variable will only exist for the duration of the current
    request. At the end of the request the environment is
    restored to its original state."

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-04-06

    Logged In: YES
    user_id=225877

    if we create $TZ_ARRAY (include/options/personal.php) with
    zone names in keys and country names in values, it might be
    difficult to display it in options.

    Some time zones have more than 5 countries/states or names
    are long.

    i think we might have to use decimal identification for each
    time zone.

    [0]['zone']=null;
    [0]['name']=_("Same as server");
    [1]['zone']='ACRE5';
    [1]['name']=_("Brazil (Trinity of Acre)");
    [2]['zone']='AST10ADT';
    [2]['name']=_("USA (Aleutian Islands)");
    [3]['zone']='AST4ADT';
    [3]['name']=_("Bermuda");
    [4]['zone']='AST4ADT';
    [4]['name']=_("Canada (Atlantic)");
    ...

    if we use such time zone list, we'll have to maintain it.
    Currently used timezone formating depends on system libraries.

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-07-06

    • assigned_to: nobody --> tokul
     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-07-08

    Logged In: YES
    user_id=225877

    can you check attached patch for squirrelmail 1.4.4?

    If you have problems with patches, I can provide all
    modified files.

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-07-10

    Logged In: YES
    user_id=225877

    GMT instead of selected TZ issue should be fixed in 1.5.1cvs.

    config/conf.pl v.1.217 and include/validate.php 1.19

    timestamp issue can't be fixed in SquirrelMail. Problem is
    in apache/php environment handling.

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-07-10

    • labels: 102902 -->
     
  • Tomas Kuliavas
    Tomas Kuliavas
    2006-02-19

    • assigned_to: tokul --> nobody