From: moodler Date: Wed, 11 Aug 2004 07:55:40 +0000 (+0000) Subject: Finally? Fixed the digest mail sending time (it was a timezone issue). X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=944a2b287054ae755bff4ec0b893bfce23dca3d0;p=moodle.git Finally? Fixed the digest mail sending time (it was a timezone issue). --- diff --git a/mod/forum/lib.php b/mod/forum/lib.php index b1ba8b399e..a78fcdb7ae 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -324,6 +324,12 @@ function forum_cron () { unset($CFG->courselang); + if (!empty($realuser)) { // Restore real USER timezone if necessary + $sitetimezone = $realuser->timezone; + } else { + $sitetimezone = $CFG->timezone; + } + /// Now see if there are any digest mails waiting to be sent, and if we should send them if (!isset($CFG->digestmailtimelast)) { // To catch the first time @@ -331,7 +337,7 @@ function forum_cron () { } $timenow = time(); - $digesttime = usergetmidnight($timenow) + ($CFG->digestmailtime * 3600); + $digesttime = usergetmidnight($timenow, $sitetimezone) + ($CFG->digestmailtime * 3600); if ($CFG->digestmailtimelast < $digesttime and $timenow > $digesttime) { set_config('digestmailtimelast', $timenow);