Changeset 285 in subversion for trunk/roundcubemail/program/include/rcube_imap.inc
- Timestamp:
- Jul 30, 2006 3:38:06 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap.inc
r283 r285 1246 1246 1247 1247 // 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) 1249 1249 { 1250 1250 $result = FALSE; … … 1252 1252 // replace backslashes 1253 1253 $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); 1260 1260 $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 } 1270 1271 1271 1272 return $result ? $name : FALSE;
Note: See TracChangeset
for help on using the changeset viewer.
