From 531abb1a95587cf3fb02c580d89cdc95a32e98d3 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 29 May 2008 06:43:29 -0400
Subject: [PATCH] -set utf8 locales in setlocale()

---
 program/include/rcmail.php |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index e57b5dd..08de43e 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -62,14 +62,11 @@
   
   /**
    * Private constructor
-   *
-   * @todo Remove global $CONFIG
    */
   private function __construct()
   {
     // load configuration
     $this->config = new rcube_config();
-    $GLOBALS['CONFIG'] = $this->config->all();
     
     register_shutdown_function(array($this, 'shutdown'));
   }
@@ -164,9 +161,9 @@
     }
     
     $_SESSION['language'] = $this->user->language = $this->language_prop($this->config->get('language'));
-    
+
     // set localization
-    setlocale(LC_ALL, $_SESSION['language']);
+    setlocale(LC_ALL, $_SESSION['language'] . '.utf8');
   }
   
   
@@ -588,9 +585,9 @@
       @include(INSTALL_PATH . 'program/localization/en_US/messages.inc');
 
       if (is_array($labels))
-        $sa_text_data = $labels;
+        $this->texts = $labels;
       if (is_array($messages))
-        $sa_text_data = array_merge($sa_text_data, $messages);
+        $this->texts = array_merge($this->texts, $messages);
 
       // include user language files
       if ($lang != 'en' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) {
@@ -761,7 +758,7 @@
    * @param string Password to encrypt
    * @return string Encryprted string
    */
-  private function encrypt_passwd($pass)
+  public function encrypt_passwd($pass)
   {
     if (function_exists('mcrypt_module_open') && ($td = mcrypt_module_open(MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, ""))) {
       $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);

--
Gitblit v1.9.1