diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-06-13 10:15:25 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-06-13 10:15:25 +0000 |
| commit | 61ceeb27d9aceab2af200c576c26633adca72bc2 (patch) | |
| tree | 907df7ee7b64cd32bfa4a32459f23734b2ecea10 /roundcubemail/program/steps/mail/func.inc | |
| parent | b103e23fdf0d169c073e57dbf0d1938192fb963f (diff) | |
- Use user's timezone in Date header, not server's timezone (#1486119)
git-svn-id: https://svn.roundcube.net/trunk@3746 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/func.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/func.inc | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc index defb6f9cc..c7489148e 100644 --- a/roundcubemail/program/steps/mail/func.inc +++ b/roundcubemail/program/steps/mail/func.inc @@ -1478,7 +1478,7 @@ function rcmail_send_mdn($uid, &$smtp_error) // compose headers array $headers = array( - 'Date' => date('r'), + 'Date' => rcmail_user_date(), 'From' => $sender, 'To' => $message->headers->mdn_to, 'Subject' => rcube_label('receiptread') . ': ' . $message->subject, @@ -1523,6 +1523,30 @@ function rcmail_send_mdn($uid, &$smtp_error) return false; } +// Returns RFC2822 formatted current date in user's timezone +function rcmail_user_date() +{ + global $CONFIG; + + // get user's timezone + if ($CONFIG['timezone'] === 'auto') { + console($_SESSION['timezone']); + $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600; + } + else { + $tz = $CONFIG['timezone']; + if ($CONFIG['dst_active']) + $tz++; + } + + $date = time() + $tz * 60 * 60; + $date = gmdate('r', $date); + $date = preg_replace('/[+-][0-9]{4}$/', sprintf('%+05d', $tz * 100), $date); + + return $date; +} + + function rcmail_search_filter($attrib) { global $OUTPUT, $CONFIG; |
