From 95609c48f5f51a2a662d2b77d55aad6fae73a112 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 12 Jun 2007 15:05:59 -0400
Subject: [PATCH] Minor bugfixes reported on the dev-list

---
 CHANGELOG                       |    9 +++++++++
 program/include/main.inc        |   35 +++++++++++++++++++----------------
 program/steps/mail/sendmail.inc |    2 +-
 3 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index e58d643..75073f9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,15 @@
 CHANGELOG RoundCube Webmail
 ---------------------------
 
+2007/06/12 (thomasb)
+----------
+- Updated Turkish, Polish, Finnish/Suomi, Japanese, Hungarian, Greek, Euskara localization
+- Added Irish/Gaelic translation
+- Little correction in Swedish translation
+- Quote username for virtuser_query
+- Pass-by-reference workarround for PHP5 in sendmail.inc
+
+
 2007/06/04 (estadtherr)
 ----------
 - Fixed bug in HTML->Plain editor toggling
diff --git a/program/include/main.inc b/program/include/main.inc
index 0332e3a..53d4d85 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -577,7 +577,7 @@
 
 // create new entry in users and identities table
 function rcmail_create_user($user, $host)
-  {
+{
   global $DB, $CONFIG, $IMAP;
 
   $user_email = '';
@@ -595,7 +595,7 @@
               $_SESSION['user_lang']);
 
   if ($user_id = $DB->insert_id(get_sequence_name('users')))
-    {
+  {
     $mail_domain = rcmail_mail_domain($host);
    
     if ($user_email=='')
@@ -605,19 +605,21 @@
 
     // try to resolve the e-mail address from the virtuser table
     if (!empty($CONFIG['virtuser_query']) &&
-        ($sql_result = $DB->query(preg_replace('/%u/', $user, $CONFIG['virtuser_query']))) &&
+        ($sql_result = $DB->query(preg_replace('/%u/', $DB->quote($user), $CONFIG['virtuser_query']))) &&
         ($DB->num_rows()>0))
+    {
       while ($sql_arr = $DB->fetch_array($sql_result))
-        {
+      {
         $DB->query("INSERT INTO ".get_table_name('identities')."
                    (user_id, del, standard, name, email)
                    VALUES (?, 0, 1, ?, ?)",
                    $user_id,
                    strip_newlines($user_name),
                    preg_replace('/^@/', $user . '@', $sql_arr[0]));
-        }
+      }
+    }
     else
-      {
+    {
       // also create new identity records
       $DB->query("INSERT INTO ".get_table_name('identities')."
                   (user_id, del, standard, name, email)
@@ -625,22 +627,23 @@
                   $user_id,
                   strip_newlines($user_name),
                   strip_newlines($user_email));
-      }
+    }
                        
     // get existing mailboxes
     $a_mailboxes = $IMAP->list_mailboxes();
-    }
+  }
   else
-    {
-    raise_error(array('code' => 500,
-                      'type' => 'php',
-                      'line' => __LINE__,
-                      'file' => __FILE__,
-                      'message' => "Failed to create new user"), TRUE, FALSE);
-    }
+  {
+    raise_error(array(
+      'code' => 500,
+      'type' => 'php',
+      'line' => __LINE__,
+      'file' => __FILE__,
+      'message' => "Failed to create new user"), TRUE, FALSE);
+  }
     
   return $user_id;
-  }
+}
 
 
 // load virtuser table in array
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 37b57e2..929f3ed 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -333,7 +333,7 @@
   
     // send message
     $smtp_response = array();
-    $sent = smtp_mail($from, $a_recipients, $MAIL_MIME->txtHeaders($send_headers), $msg_body, $smtp_response);
+    $sent = smtp_mail($from, $a_recipients, ($foo = $MAIL_MIME->txtHeaders($send_headers)), $msg_body, $smtp_response);
   
     // log error
     if (!$sent)

--
Gitblit v1.9.1