From 0cbc094164c8a0fa3543e07105e06c129f679805 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 14 Nov 2005 19:09:44 -0500
Subject: [PATCH] SMTPS support and minor bugfixes

---
 CHANGELOG                        |    1 +
 program/include/rcube_shared.inc |    8 +++++---
 program/include/main.inc         |    8 +++++++-
 UPGRADING                        |    9 ++++++---
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 0832ed5..6e33704 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -80,4 +80,5 @@
 - Added Reply-To-All functionality (Request #1326395, Patch #1349777)
 - Redesign of client side AJAX code (enable multi threading)
 - Added keep-alive signal every minute
+- Make logs dir configurable
 - Added support for SMTPS
diff --git a/UPGRADING b/UPGRADING
index 85666dc..57be50b 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -5,7 +5,6 @@
 of RoundCube Webmail.
 
 
-
 from versions 0.1-alpha and 0.1-20050811
 ----------------------------------------
 - replace index.php
@@ -22,6 +21,7 @@
   $rcmail_config['session_lifetime'] = 20;
   $rcmail_config['message_sort_col'] = 'date';
   $rcmail_config['message_sort_order'] = 'DESC';
+  $rcmail_config['log_dir'] = 'logs/';
 - replace database properties (db_type, db_host, db_user, db_pass, $d_name)
   in /config/db.inc.php with the following line:
   $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
@@ -39,7 +39,8 @@
   $rcmail_config['default_port'] = 143;
   $rcmail_config['session_lifetime'] = 20;
   $rcmail_config['message_sort_col'] = 'date';
-  $rcmail_config['message_sort_order'] = 'DESC';  
+  $rcmail_config['message_sort_order'] = 'DESC';
+  $rcmail_config['log_dir'] = 'logs/';
 - replace database properties (db_type, db_host, db_user, db_pass, $d_name)
   in /config/db.inc.php with the following line:
   $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
@@ -55,7 +56,8 @@
   $rcmail_config['session_lifetime'] = 20;  // to specify the session lifetime in minutes
   $rcmail_config['message_sort_col'] = 'date';
   $rcmail_config['message_sort_order'] = 'DESC';
-
+  $rcmail_config['log_dir'] = 'logs/';
+  
 
 from version 0.1-20051021
 ----------------------------------------
@@ -65,3 +67,4 @@
 - add these lines to /config/main.inc.php
   $rcmail_config['message_sort_col'] = 'date';
   $rcmail_config['message_sort_order'] = 'DESC';
+  $rcmail_config['log_dir'] = 'logs/';
diff --git a/program/include/main.inc b/program/include/main.inc
index 306d210..936cad3 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -261,16 +261,22 @@
 // set localization charset based on the given language
 function rcmail_set_locale($lang)
   {
-  global $OUTPUT, $INSTLL_PATH;
+  global $OUTPUT, $INSTLL_PATH, $CHARSET;
   static $rcube_charsets;
 
   if (!$rcube_charsets)
     @include($INSTLL_PATH.'program/localization/index.inc');
 
   if (isset($rcube_charsets[$lang]))
+    {
     $OUTPUT->set_charset($rcube_charsets[$lang]);
+    $CHARSET = $rcube_charsets[$lang];
+    }
   else
+    {
     $OUTPUT->set_charset('ISO-8859-1');
+    $CHARSET = 'ISO-8859-1';
+    }
   }
 
 
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index 9b1b23b..8d26d56 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -1188,7 +1188,7 @@
 // replace specials characters to a specific encoding type
 function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
   {
-  global $OUTPUT_TYPE;
+  global $OUTPUT_TYPE, $CHARSET;
   static $html_encode_arr, $js_rep_table, $rtf_rep_table, $xml_rep_table;
 
   if (!$enctype)
@@ -1208,7 +1208,7 @@
     {
     if (!$html_encode_arr)
       {
-      $html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS); // HTML_ENTITIES
+      $html_encode_arr = $CHARSET=='ISO-8859-1' ? get_html_translation_table(HTML_ENTITIES) : get_html_translation_table(HTML_SPECIALCHARS);
       $html_encode_arr[chr(128)] = '&euro;';
       unset($html_encode_arr['?']);
       unset($html_encode_arr['&']);
@@ -1245,9 +1245,11 @@
     for ($c=160; $c<256; $c++)  // can be increased to support more charsets
       {
       $hex = dechex($c);
-      //$js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex);
       $rtf_rep_table[Chr($c)] = "\\'$hex";
       $xml_rep_table[Chr($c)] = "&#$c;";
+      
+      if ($CHARSET=='ISO-8859-1')
+        $js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex);
       }
 
     $js_rep_table['"'] = sprintf("\u%s%s", str_repeat('0', 4-strlen(dechex(34))), dechex(34));

--
Gitblit v1.9.1