From b08caf5813c43e8648cdf5db1e003b3046a37c2c Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 31 Aug 2011 08:49:44 -0400
Subject: [PATCH] - Applied fixes from trunk up to r5150

---
 program/include/main.inc |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/program/include/main.inc b/program/include/main.inc
index 0401fe2..7e85e01 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1021,7 +1021,7 @@
  */
 function format_date($date, $format=NULL)
 {
-  global $CONFIG;
+  global $RCMAIL, $CONFIG;
   
   $ts = NULL;
 
@@ -1032,13 +1032,7 @@
     return '';
 
   // get user's timezone
-  if ($CONFIG['timezone'] === 'auto')
-    $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;
-  else {
-    $tz = $CONFIG['timezone'];
-    if ($CONFIG['dst_active'])
-      $tz++;
-  }
+  $tz = $RCMAIL->config->get_timezone();
 
   // convert time to user's timezone
   $timestamp = $ts - date('Z', $ts) + ($tz * 3600);
@@ -1659,12 +1653,13 @@
  * @param string $from       Sender address string
  * @param array  $mailto     Array of recipient address strings
  * @param array  $smtp_error SMTP error array (reference)
- * @param string $body_file  Location of file with saved message body (reference)
+ * @param string $body_file  Location of file with saved message body (reference),
+ *                           used when delay_file_io is enabled
  * @param array  $smtp_opts  SMTP options (e.g. DSN request)
  *
  * @return boolean Send status.
  */
-function rcmail_deliver_message(&$message, $from, $mailto, &$smtp_error, &$body_file, $smtp_opts=null)
+function rcmail_deliver_message(&$message, $from, $mailto, &$smtp_error, &$body_file=null, $smtp_opts=null)
 {
   global $CONFIG, $RCMAIL;
 
@@ -1823,17 +1818,10 @@
 // Returns RFC2822 formatted current date in user's timezone
 function rcmail_user_date()
 {
-  global $CONFIG;
+  global $RCMAIL, $CONFIG;
 
   // get user's timezone
-  if ($CONFIG['timezone'] === 'auto') {
-    $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;
-  }
-  else {
-    $tz = $CONFIG['timezone'];
-    if ($CONFIG['dst_active'])
-      $tz++;
-  }
+  $tz = $RCMAIL->config->get_timezone();
 
   $date = time() + $tz * 60 * 60;
   $date = gmdate('r', $date);

--
Gitblit v1.9.1