From fda695f29732f5e5bcaa55e7e7abd090d2359927 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 01 Sep 2006 13:14:51 -0400
Subject: [PATCH] Finalized quota image

---
 program/include/main.inc |   33 ++++++++++++++++++++++-----------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/program/include/main.inc b/program/include/main.inc
index 051d6e2..9214948 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -466,7 +466,7 @@
       
     // update user's record
     $DB->query("UPDATE ".get_table_name('users')."
-                SET    last_login=now()
+                SET    last_login=".$DB->now()."
                 WHERE  user_id=?",
                 $user_id);
     }
@@ -511,7 +511,7 @@
 
   $DB->query("INSERT INTO ".get_table_name('users')."
               (created, last_login, username, mail_host, alias, language)
-              VALUES (now(), now(), ?, ?, ?, ?)",
+              VALUES (".$DB->now().", ".$DB->now().", ?, ?, ?, ?)",
               $user,
               $host,
               $user_email,
@@ -519,14 +519,7 @@
 
   if ($user_id = $DB->insert_id(get_sequence_name('users')))
     {
-    $mail_domain = $host;
-    if (is_array($CONFIG['mail_domain']))
-      {
-      if (isset($CONFIG['mail_domain'][$host]))
-        $mail_domain = $CONFIG['mail_domain'][$host];
-      }
-    else if (!empty($CONFIG['mail_domain']))
-      $mail_domain = $CONFIG['mail_domain'];
+    $mail_domain = rcmail_mail_domain($host);
    
     if ($user_email=='')
       $user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $mail_domain);
@@ -921,7 +914,6 @@
       {
       $html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS);        
       unset($html_encode_arr['?']);
-      unset($html_encode_arr['&']);
       }
 
     $ltpos = strpos($str, '<');
@@ -933,6 +925,7 @@
       unset($encode_arr['"']);
       unset($encode_arr['<']);
       unset($encode_arr['>']);
+      unset($encode_arr['&']);
       }
     else if ($mode=='remove')
       $str = strip_tags($str);
@@ -1646,6 +1639,24 @@
   }
 
 
+// return the mail domain configured for the given host
+function rcmail_mail_domain($host)
+  {
+  global $CONFIG;
+
+  $domain = $host;
+  if (is_array($CONFIG['mail_domain']))
+    {
+    if (isset($CONFIG['mail_domain'][$host]))
+      $domain = $CONFIG['mail_domain'][$host];
+    }
+  else if (!empty($CONFIG['mail_domain']))
+    $domain = $CONFIG['mail_domain'];
+
+  return $domain;
+  }
+
+
 // return code for the webmail login form
 function rcmail_login_form($attrib)
   {

--
Gitblit v1.9.1