Changeset fa4cd20 in github


Ignore:
Timestamp:
Aug 4, 2006 8:10:34 AM (7 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
42000a5
Parents:
c4e7e4f
Message:

Several bugfixes; see CHANGELOG for details

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rf9c107a rfa4cd20  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42006/08/04 (thomasb) 
     5---------- 
     6- Fixed Bug in saving identities (Ticket #1483915) 
     7- Set folder name in window title (Bug #1483919) 
     8- Don't add imap_root to INBOX path (Bug #1483816) 
     9- Attempt to create default folders only after login 
     10- Avoid usage of $CONFIG in rcube_imap class 
     11 
    312 
    4132006/07/30 (thomasb) 
  • config/main.inc.php.dist

    rbac7d17 rfa4cd20  
    138138$rcmail_config['trash_mbox'] = 'Trash'; 
    139139 
    140 // display these folders separately in the mailbox list 
     140// display these folders separately in the mailbox list. 
     141// these folders will automatically be created if they do not exist 
    141142$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash'); 
    142143 
  • program/include/main.inc

    r41fa0b9 rfa4cd20  
    206206    $IMAP->set_caching(TRUE); 
    207207 
    208   if (is_array($CONFIG['default_imap_folders'])) 
    209     $IMAP->set_default_mailboxes($CONFIG['default_imap_folders']); 
    210  
    211208  // set pagesize from config 
    212209  if (isset($CONFIG['pagesize'])) 
     
    224221  if (!empty($CONFIG['imap_root'])) 
    225222    $IMAP->set_rootdir($CONFIG['imap_root']); 
     223 
     224  if (is_array($CONFIG['default_imap_folders'])) 
     225    $IMAP->set_default_mailboxes($CONFIG['default_imap_folders']); 
    226226 
    227227  if (!empty($_SESSION['mbox'])) 
     
    511511    $_SESSION['password']  = encrypt_passwd($pass); 
    512512 
    513     // force reloading complete list of subscribed mailboxes     
     513    // force reloading complete list of subscribed mailboxes 
     514    rcmail_set_imap_prop(); 
    514515    $IMAP->clear_cache('mailboxes'); 
     516    $IMAP->create_default_folders(); 
    515517 
    516518    return TRUE; 
  • program/include/rcube_imap.inc

    rc4e7e4f rfa4cd20  
    3737 * @package    RoundCube Webmail 
    3838 * @author     Thomas Bruederli <roundcube@gmail.com> 
    39  * @version    1.30 
     39 * @version    1.31 
    4040 * @link       http://ilohamail.org 
    4141 */ 
     
    5353  var $delimiter = NULL; 
    5454  var $caching_enabled = FALSE; 
    55   var $default_folders = array('inbox', 'drafts', 'sent', 'junk', 'trash'); 
     55  var $default_folders = array('INBOX'); 
     56  var $default_folders_lc = array('inbox'); 
    5657  var $cache = array(); 
    5758  var $cache_keys = array();   
     
    209210    if (is_array($arr)) 
    210211      { 
    211       $this->default_folders = array(); 
    212        
    213       // add mailbox names lower case 
    214       foreach ($arr as $mbox_row) 
    215         $this->default_folders[] = strtolower($mbox_row); 
    216        
     212      $this->default_folders = $arr; 
     213      $this->default_folders_lc = array(); 
     214 
    217215      // add inbox if not included 
    218       if (!in_array('inbox', $this->default_folders)) 
    219         array_unshift($arr, 'inbox'); 
     216      if (!in_array_nocase('INBOX', $this->default_folders)) 
     217        array_unshift($this->default_folders, 'INBOX'); 
     218 
     219      // create a second list with lower cased names 
     220      foreach ($this->default_folders as $mbox) 
     221        $this->default_folders_lc[] = strtolower($mbox); 
    220222      } 
    221223    } 
     
    334336      } 
    335337 
     338    // INBOX should always be available 
     339    if (!in_array_nocase('INBOX', $a_out)) 
     340      array_unshift($a_out, 'INBOX'); 
     341 
    336342    // sort mailboxes 
    337343    $a_out = $this->_sort_mailbox_list($a_out); 
     
    362368    if (!is_array($a_folders) || !sizeof($a_folders)) 
    363369      $a_folders = array(); 
    364  
    365     // create Default folders if they do not exist 
    366     global $CONFIG; 
    367     foreach ($CONFIG['default_imap_folders'] as $folder) 
    368       { 
    369       if (!in_array_nocase($folder, $a_folders)) 
    370         { 
    371         $this->create_mailbox($folder, TRUE); 
    372         $this->subscribe($folder); 
    373         } 
    374       } 
    375  
    376     $a_folders = iil_C_ListSubscribed($this->conn, $this->_mod_mailbox($root), $filter); 
    377     $a_mailbox_cache = array(); 
    378370 
    379371    // write mailboxlist to cache 
     
    11561148 
    11571149 
    1158   // return an array with all folders available in IMAP server 
     1150  /** 
     1151   * Get a list of all folders available on the IMAP server 
     1152   *  
     1153   * @param string IMAP root dir 
     1154   * @return array Inbdexed array with folder names  
     1155   */ 
    11591156  function list_unsubscribed($root='') 
    11601157    { 
     
    11981195 
    11991196 
    1200   // subscribe to a specific mailbox(es) 
     1197  /** 
     1198   * subscribe to a specific mailbox(es) 
     1199   */  
    12011200  function subscribe($mbox_name, $mode='subscribe') 
    12021201    { 
     
    12111210 
    12121211 
    1213   // unsubscribe mailboxes 
     1212  /** 
     1213   * unsubscribe mailboxes 
     1214   */ 
    12141215  function unsubscribe($mbox_name) 
    12151216    { 
     
    12241225 
    12251226 
    1226   // create a new mailbox on the server and register it in local cache 
     1227  /** 
     1228   * create a new mailbox on the server and register it in local cache 
     1229   */ 
    12271230  function create_mailbox($name, $subscribe=FALSE) 
    12281231    { 
     
    12391242    $abs_name = $this->_mod_mailbox($name_enc); 
    12401243    $a_mailbox_cache = $this->get_cache('mailboxes'); 
    1241          
    1242     if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array($abs_name, $a_mailbox_cache))) 
     1244 
     1245    if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array_nocase($abs_name, $a_mailbox_cache))) 
    12431246      $result = iil_C_CreateFolder($this->conn, $abs_name); 
    12441247 
    1245     // update mailboxlist cache 
    1246     if ($result && $subscribe) 
     1248    // try to subscribe it 
     1249    if ($subscribe) 
    12471250      $this->subscribe($name_enc); 
    12481251 
     
    12511254 
    12521255 
    1253   // set a new name to an existing mailbox 
     1256  /** 
     1257   * set a new name to an existing mailbox 
     1258   */ 
    12541259  function rename_mailbox($mbox_name, $new_name) 
    12551260    { 
     
    12801285 
    12811286 
    1282   // remove mailboxes from server 
     1287  /** 
     1288   * remove mailboxes from server 
     1289   */ 
    12831290  function delete_mailbox($mbox_name) 
    12841291    { 
     
    12971304        // unsubscribe mailbox before deleting 
    12981305        iil_C_UnSubscribe($this->conn, $mailbox); 
    1299          
     1306 
    13001307        // send delete command to server 
    13011308        $result = iil_C_DeleteFolder($this->conn, $mailbox); 
     
    13141321    } 
    13151322 
     1323 
     1324  /** 
     1325   * Create all folders specified as default 
     1326   */ 
     1327  function create_default_folders() 
     1328    { 
     1329    $a_folders = iil_C_ListMailboxes($this->conn, $this->_mod_mailbox(''), '*'); 
     1330    $a_subscribed = iil_C_ListSubscribed($this->conn, $this->_mod_mailbox(''), '*'); 
     1331     
     1332    // create default folders if they do not exist 
     1333    foreach ($this->default_folders as $folder) 
     1334      { 
     1335      $abs_name = $this->_mod_mailbox($folder); 
     1336      if (!in_array_nocase($abs_name, $a_subscribed)) 
     1337        { 
     1338        if (!in_array_nocase($abs_name, $a_folders)) 
     1339          $this->create_mailbox($folder, TRUE); 
     1340        else 
     1341          $this->subscribe($folder); 
     1342        } 
     1343      } 
     1344    } 
    13161345 
    13171346 
     
    18311860  function _mod_mailbox($mbox_name, $mode='in') 
    18321861    { 
    1833     if ((!empty($this->root_ns) && $this->root_ns == $mbox_name) || ($mbox_name == 'INBOX' && $mode == 'in')) 
     1862    if ((!empty($this->root_ns) && $this->root_ns == $mbox_name) || $mbox_name == 'INBOX') 
    18341863      return $mbox_name; 
    18351864 
     
    18531882      if ($folder{0}=='.') 
    18541883        continue; 
    1855          
    1856       if (($p = array_search(strtolower($folder), $this->default_folders))!==FALSE) 
     1884 
     1885      if (($p = array_search(strtolower($folder), $this->default_folders_lc))!==FALSE) 
    18571886        $a_defaults[$p] = $folder; 
    18581887      else 
  • program/js/app.js

    r41fa0b9 rfa4cd20  
    32133213        } 
    32143214      } 
     3215       
     3216    // also update mailbox name in window title 
     3217    if (document.title) 
     3218      { 
     3219      var doc_title = String(document.title); 
     3220      var reg = new RegExp(this.env.mailbox.toLowerCase(), 'i'); 
     3221      if (this.env.mailbox && doc_title.match(reg)) 
     3222        document.title = doc_title.replace(reg, mbox).replace(/^\([0-9]+\)\s+/i, ''); 
     3223      } 
    32153224     
    32163225    this.env.mailbox = mbox; 
  • program/steps/settings/save_identity.inc

    rad57b3ab rfa4cd20  
    6262    } 
    6363        
    64   if ($updated) 
     64  if ($updated && !empty($_POST['_standard'])) 
    6565    { 
    6666    show_message('successfullysaved', 'confirmation'); 
Note: See TracChangeset for help on using the changeset viewer.