Changeset 130 in subversion


Ignore:
Timestamp:
Feb 4, 2006 2:08:10 PM (7 years ago)
Author:
roundcube
Message:

Bugfixes for encoding and sending with attachments

Location:
trunk/roundcubemail
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/.htaccess

    r92 r130  
    1 php_flag   display_errors       On 
    2 php_value  upload_max_filesize  2m 
     1AddDefaultCharset       UTF-8 
     2php_flag        display_errors  On 
     3php_value       upload_max_filesize     2m 
    34 
    45<FilesMatch "(\.inc|\~)$|^_"> 
  • trunk/roundcubemail/CHANGELOG

    r119 r130  
    22--------------------------- 
    33 
    4 2006/01/19 
     42006/02/04 
    55---------- 
    6 - Added Slovak translation 
     6- Added Slovak, Hungarian, Bosnian and Croation translation 
    77- Fixed bug when inserting signatures with !?& 
    88- Chopping message headers before inserting into the message cache table (to avoid bugs in Postgres) 
     
    2121- Applied patch for correct ctrl/shift behavior for message selection (Bug #1326364) 
    2222- Casting to strings when adding empty headers to message cache (Bug #1406026) 
     23- Skip sender-address as recipient when Reply-to-all 
     24- Fixes in utf8-class 
     25- Added patch for Quota display by Aury Fink Filho <nuny@aury.com.br> 
    2326 
    2427 
  • trunk/roundcubemail/SQL/sqlite.initial.sql

    r125 r130  
    3232  contact_id integer NOT NULL PRIMARY KEY, 
    3333  user_id integer NOT NULL default '0', 
    34   created datetime NOT NULL default '0000-00-00 00:00:00', 
     34  changed datetime NOT NULL default '0000-00-00 00:00:00', 
    3535  del tinyint NOT NULL default '0', 
    3636  name varchar(128) NOT NULL default '', 
  • trunk/roundcubemail/config/main.inc.php.dist

    r111 r130  
    8686$rcmail_config['ip_check'] = TRUE; 
    8787 
    88 // not sure what this was good for :-)  
     88// the default locale setting 
    8989$rcmail_config['locale_string'] = 'en'; 
    9090 
  • trunk/roundcubemail/index.php

    r127 r130  
    6464ini_set('session.gc_maxlifetime', 21600); 
    6565ini_set('session.gc_divisor', 500); 
     66ini_set('magic_quotes_gpc', 0); 
    6667ini_set('error_reporting', E_ALL&~E_NOTICE);  
    6768 
  • trunk/roundcubemail/program/include/main.inc

    r114 r130  
    7272  // we can use the database for storing session data 
    7373  // session queries do not work with MDB2 
    74   if ($CONFIG['db_backend']!='mdb2' && is_object($DB) /* && $DB->db_provider!='sqlite' */) 
     74  if ($CONFIG['db_backend']!='mdb2' && is_object($DB)) 
    7575    include_once('include/session.inc'); 
    7676 
     
    710710     
    711711  // convert charset using iconv module   
    712   if (function_exists('iconv') && $from!='UTF-7' && $to!='UTF-7') { 
     712  if (0 && function_exists('iconv') && $from!='UTF-7' && $to!='UTF-7') { 
    713713    return iconv($from, $to, $str); 
    714714    } 
    715      
     715 
     716  $conv = new utf8(); 
     717 
    716718  // convert string to UTF-8 
    717719  if ($from=='UTF-7') 
     
    721723  else if ($from!='UTF-8') 
    722724    { 
    723     $conv = new utf8($from); 
     725    $conv->loadCharset($from); 
    724726    $str = $conv->strToUtf8($str); 
    725727    } 
     
    732734  else if ($to!='UTF-8') 
    733735    { 
    734     $conv = new utf8($to);     
     736    $conv->loadCharset($to); 
    735737    return $conv->utf8ToStr($str); 
    736738    } 
     
    961963        'messages' => 'rcmail_message_list', 
    962964        'messagecountdisplay' => 'rcmail_messagecount_display', 
     965        'quotadisplay' => 'rcmail_quota_display', 
    963966        'messageheaders' => 'rcmail_message_headers', 
    964967        'messagebody' => 'rcmail_message_body', 
  • trunk/roundcubemail/program/include/rcube_imap.inc

    r127 r130  
    10581058 
    10591059 
     1060  /** 
     1061   * Get quota 
     1062   * added by Nuny 
     1063   */ 
     1064  function get_quota() 
     1065    { 
     1066    if ($this->get_capability('QUOTA')) 
     1067      { 
     1068      $result = iil_C_GetQuota($this->conn); 
     1069      return sprintf("%.2fMB / %.2fMB (%.0f%%)", $result["used"] / 1000.0, $result["total"] / 1000.0, $result["percent"]); 
     1070      } 
     1071    else 
     1072      return 'unknown'; 
     1073    } 
     1074 
     1075 
    10601076  // subscribe to a specific mailbox(es) 
    10611077  function subscribe($mbox, $mode='subscribe') 
  • trunk/roundcubemail/program/js/app.js

    r128 r130  
    232232 
    233233    // disable browser's contextmenus 
    234     //document.oncontextmenu = function(){ return false; } 
     234    document.oncontextmenu = function(){ return false; } 
    235235 
    236236    // load body click event 
     
    26462646    }; 
    26472647 
     2648  // replace content of quota display 
     2649   this.set_quota = function(text) 
     2650     { 
     2651     if (this.gui_objects.quotadisplay) 
     2652       this.gui_objects.quotadisplay.innerHTML = text; 
     2653     }; 
     2654                              
    26482655 
    26492656  // update the mailboxlist 
  • trunk/roundcubemail/program/lib/utf8.class.php

    r116 r130  
    5959Class utf8{ 
    6060 
    61   var $charset = CP1250; 
     61  var $charset = "ISO-8859-1"; 
    6262  var $ascMap = array(); 
    6363  var $utfMap = array(); 
    64    
     64 
    6565  // made PHP5 capable by RoundCube 
    6666  function __construct($charset="ISO-8859-1"){ 
     
    7676  function loadCharset($charset){ 
    7777    global $utf8_maps; 
    78      
     78 
    7979    if (!is_file($utf8_maps[$charset])) 
    8080      { 
     
    171171 
    172172} 
     173 
    173174?> 
  • trunk/roundcubemail/program/steps/mail/check_recent.inc

    r127 r130  
    3131  $commands .= sprintf("this.set_env('messagecount', %d);\n", $count); 
    3232  $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text()); 
    33    
     33  $commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota()); 
     34  
    3435  // add new message headers to list 
    3536  $a_headers = array(); 
  • trunk/roundcubemail/program/steps/mail/compose.inc

    r92 r130  
    146146    if ($header=='to' && $REPLY_MESSAGE['headers']->replyto) 
    147147      $fvalue = $IMAP->decode_header($REPLY_MESSAGE['headers']->replyto); 
     148 
    148149    else if ($header=='to' && $REPLY_MESSAGE['headers']->from) 
    149150      $fvalue = $IMAP->decode_header($REPLY_MESSAGE['headers']->from); 
     151 
    150152    // add recipent of original message if reply to all 
    151153    else if ($header=='cc' && $REPLY_MESSAGE['reply_all']) 
     
    170172      foreach ($to_addresses as $addr_part) 
    171173        { 
    172         if (!in_array($addr_part['mailto'], $sa_recipients)) 
     174        if (!in_array($addr_part['mailto'], $sa_recipients) && (!$REPLY_MESSAGE['FROM'] || !in_array($addr_part['mailto'], $REPLY_MESSAGE['FROM']))) 
    173175          { 
    174176          $fvalue .= (strlen($fvalue) ? ', ':'').$addr_part['string']; 
     
    215217  if ($REPLY_MESSAGE && is_object($REPLY_MESSAGE['headers'])) 
    216218    { 
     219    $REPLY_MESSAGE['FROM'] = array(); 
     220 
    217221    $a_to = $IMAP->decode_address_list($REPLY_MESSAGE['headers']->to);         
    218222    foreach ($a_to as $addr) 
     
    260264      if (in_array($sql_arr['email'], $a_recipients)) 
    261265        $from_id = $sql_arr['identity_id']; 
     266         
     267      if ($REPLY_MESSAGE && is_array($REPLY_MESSAGE['FROM'])) 
     268        $REPLY_MESSAGE['FROM'][] = $sql_arr['email']; 
    262269      } 
    263270 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r127 r130  
    546546 
    547547 
     548function rcmail_quota_display($attrib) 
     549  { 
     550  global $IMAP, $OUTPUT, $JS_OBJECT_NAME; 
     551 
     552  if (!$attrib['id']) 
     553    $attrib['id'] = 'rcmquotadisplay'; 
     554 
     555  $OUTPUT->add_script(sprintf("%s.gui_object('quotadisplay', '%s');", $JS_OBJECT_NAME, $attrib['id'])); 
     556 
     557  // allow the following attributes to be added to the <span> tag 
     558  $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id')); 
     559 
     560 
     561  $out = '<span' . $attrib_str . '>'; 
     562  $out .= $IMAP->get_quota(); 
     563  $out .= '</span>'; 
     564  return $out; 
     565  } 
     566 
    548567 
    549568function rcmail_get_messagecount_text() 
     
    581600   
    582601  $block = $plain ? '%s' : '%s'; //'<div style="display:block;">%s</div>'; 
    583   $body = $IMAP->mime_decode($body, $encoding); 
     602  $body = $IMAP->mime_decode($body, $encoding);   
    584603  $body = $IMAP->charset_decode($body, $parameters); 
    585  
    586604 
    587605  // text/html 
     
    805823 
    806824      // part text/[plain|html] OR message/delivery-status 
    807       else if (($primary_type=='text' && ($secondary_type=='plain' || $secondary_type=='html')) || 
     825      else if (($primary_type=='text' && ($secondary_type=='plain' || $secondary_type=='html') && $mail_part->disposition!='attachment') || 
    808826               ($primary_type=='message' && $secondary_type=='delivery-status')) 
    809827        { 
  • trunk/roundcubemail/program/steps/mail/move_del.inc

    r85 r130  
    7474  $commands .= sprintf("this.set_unread_count('%s', %d);\n", $_GET['_target_mbox'], $IMAP->messagecount($_GET['_target_mbox'], 'UNSEEN')); 
    7575 
     76$commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota());  
    7677 
    7778// add new rows from next page (if any) 
  • trunk/roundcubemail/program/steps/mail/sendmail.inc

    r102 r130  
    116116 
    117117// add subject 
    118 $headers['Subject'] = rcube_charset_convert(trim(stripslashes($_POST['_subject'])), $input_charset, $message_charset); 
     118$headers['Subject'] = rcube_charset_convert(trim($_POST['_subject']), $input_charset, $message_charset); 
    119119 
    120120if (strlen($identity_arr['organization'])) 
     
    145145 
    146146// fetch message body 
    147 $message_body = rcube_charset_convert(stripslashes($_POST['_message']), $input_charset, $message_charset); 
     147$message_body = rcube_charset_convert($_POST['_message'], $input_charset, $message_charset); 
    148148 
    149149// append generic footer to all messages 
     
    226226  { 
    227227  // unset some headers because they will be added by the mail() function 
    228   $headers_php = $headers; 
     228  $headers_php = $MAIL_MIME->_headers; 
    229229  $headers_enc = $MAIL_MIME->headers($headers); 
    230230  unset($headers_php['To'], $headers_php['Subject']); 
  • trunk/roundcubemail/skins/default/mail.css

    r104 r130  
    750750} 
    751751 
     752#rcmquotadisplay 
     753{ 
     754  color: #999999; 
     755  font-size: 11px; 
     756} 
  • trunk/roundcubemail/skins/default/templates/mail.html

    r127 r130  
    5151<roundcube:button command="select-all" label="all" classAct="active" />&nbsp; 
    5252<roundcube:button command="select-all" prop="unread" label="unread" classAct="active" />&nbsp; 
    53 <roundcube:button command="select-none" label="none" classAct="active" /> 
     53<roundcube:button command="select-none" label="none" classAct="active" /> &nbsp;&nbsp;&nbsp; 
     54<roundcube:label name="quota" />: <roundcube:object name="quotaDisplay" /> 
    5455</div> 
    5556 
Note: See TracChangeset for help on using the changeset viewer.