Ignore:
Timestamp:
Jul 30, 2006 3:38:06 PM (7 years ago)
Author:
thomasb
Message:

Fixed folder renaming; added confirmation after deleting a folder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_imap.inc

    r283 r285  
    12461246 
    12471247  // set a new name to an existing mailbox 
    1248   function rename_mailbox($mbox_name, $new_name, $subscribe=TRUE) 
     1248  function rename_mailbox($mbox_name, $new_name) 
    12491249    { 
    12501250    $result = FALSE; 
     
    12521252    // replace backslashes 
    12531253    $name = preg_replace('/[\\\]+/', '-', $new_name); 
    1254  
    1255     $name_enc = UTF7EncodeString($new_name); 
    1256  
    1257     // reduce mailbox name to 100 chars 
    1258     $name_enc = substr($name_enc, 0, 100); 
    1259  
     1254         
     1255    // encode mailbox name and reduce it to 100 chars 
     1256    $name_enc = substr(UTF7EncodeString($new_name), 0, 100); 
     1257 
     1258    // make absolute path 
     1259    $mailbox = $this->_mod_mailbox($mbox_name); 
    12601260    $abs_name = $this->_mod_mailbox($name_enc); 
    1261     $a_mailbox_cache = $this->get_cache('mailboxes'); 
    1262  
    1263     if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array($abs_name, $a_mailbox_cache))) 
    1264       $result = iil_C_RenameFolder($this->conn, $mbox_name, $abs_name); 
    1265  
    1266     // update mailboxlist cache 
    1267     if ($result && $subscribe) 
    1268       $this->unsubscribe($mbox_name); 
    1269       $this->subscribe($name_enc); 
     1261     
     1262    if (strlen($abs_name)) 
     1263      $result = iil_C_RenameFolder($this->conn, $mailbox, $abs_name); 
     1264     
     1265    // clear cache 
     1266    if ($result) 
     1267      { 
     1268      $this->clear_message_cache($mailbox.'.msg'); 
     1269      $this->clear_cache('mailboxes'); 
     1270      } 
    12701271 
    12711272    return $result ? $name : FALSE; 
Note: See TracChangeset for help on using the changeset viewer.