Moodle

chat time disregards site wide timezone settings

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.6.3
  • Fix Version/s: 1.9.2
  • Component/s: Chat
  • Labels:
    None
  • Environment:
    Red Hat Enterprise Linux AS4 / Apache 2.2.3 / PHP 4.4.2 / MySQL 4.1.20
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_16_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

Our site is configured to force a particular timezone on users ( Admin > Calendar -> timezones ). With DST that is currently GMT-6 (we're in Minnesota). The user accounts were initially created in September so they have timezones of GMT-5. This works fine most places, but not in chat. The current code disregards the setting in Admin>Calendar->timezones and uses the one set in the useraccount instead. To Fix this, I've applied the following patch to moodle/mod/chat/lib.php:

diff lib.php lib.php-orig
529,534d528
< if(isset($CFG->forcetimezone)){
< if($CFG->forcetimezone != 99){ < $currentuser->timezone = $CFG->forcetimezone ; < }
< }
<

This checks to see if the forcetimezone value has been set and uses it instead of the currentuser value. I've tested this with and without the Admin->Calendar->timezones setting and it seems to work properly when both the timezone is specified and when users are allowed to choose.

Matt

Activity

Hide
Dongsheng Cai added a comment -

get_user_timezone() take care of this issue. cannot reproduce, feel free to reopen if you find any other problem.

Show
Dongsheng Cai added a comment - get_user_timezone() take care of this issue. cannot reproduce, feel free to reopen if you find any other problem.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: