diff options
| author | robin <robin@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-10-15 09:17:08 +0000 |
|---|---|---|
| committer | robin <robin@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-10-15 09:17:08 +0000 |
| commit | 20e42e1b4132b3200349a48fb851a949f1036dd6 (patch) | |
| tree | 67cdff8dd51a3845bb098ebdd5f3eea274ba1284 /roundcubemail/program | |
| parent | 8f31ba8bf3787fbba72847c0be432fadb17c04d5 (diff) | |
When a parent folder is deleted, delete the children immediately, instead of one-by-one as r833 did.
git-svn-id: https://svn.roundcube.net/trunk@866 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.inc | 11 | ||||
| -rw-r--r-- | roundcubemail/program/steps/settings/manage_folders.inc | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/roundcubemail/program/include/rcube_imap.inc b/roundcubemail/program/include/rcube_imap.inc index 3fe5b1c11..9eb359457 100644 --- a/roundcubemail/program/include/rcube_imap.inc +++ b/roundcubemail/program/include/rcube_imap.inc @@ -1739,6 +1739,8 @@ class rcube_imap else if (is_string($mbox_name) && strlen($mbox_name)) $a_mboxes = explode(',', $mbox_name); + $all_mboxes = iil_C_ListMailboxes($this->conn, $this->_mod_mailbox($root), '*'); + if (is_array($a_mboxes)) foreach ($a_mboxes as $mbox_name) { @@ -1751,6 +1753,15 @@ class rcube_imap $result = iil_C_DeleteFolder($this->conn, $mailbox); if ($result>=0) $deleted = TRUE; + + foreach ($all_mboxes as $c_mbox) + if (preg_match('/^'.preg_quote($mailbox.$this->delimiter).'/', $c_mbox)) + { + iil_C_UnSubscribe($this->conn, $c_mbox); + $result = iil_C_DeleteFolder($this->conn, $c_mbox); + if ($result>=0) + $deleted = TRUE; + } } // clear mailboxlist cache diff --git a/roundcubemail/program/steps/settings/manage_folders.inc b/roundcubemail/program/steps/settings/manage_folders.inc index 344e40422..4d5882f6e 100644 --- a/roundcubemail/program/steps/settings/manage_folders.inc +++ b/roundcubemail/program/steps/settings/manage_folders.inc @@ -97,12 +97,18 @@ else if ($_action=='rename-folder') // delete an existing IMAP mailbox else if ($_action=='delete-folder') { + $a_mboxes = array_merge($IMAP->list_mailboxes(), $IMAP->list_unsubscribed()); + $delimiter = $IMAP->get_hierarchy_delimiter(); + if ($mboxes = get_input_value('_mboxes', RCUBE_INPUT_POST)) $deleted = $IMAP->delete_mailbox(array($mboxes)); if ($OUTPUT->ajax_call && $deleted) { $OUTPUT->command('remove_folder_row', get_input_value('_mboxes', RCUBE_INPUT_POST)); + foreach ($a_mboxes as $mbox) + if (preg_match('/^'.preg_quote(get_input_value('_mboxes', RCUBE_INPUT_POST).$delimiter).'/', $mbox)) + $OUTPUT->command('remove_folder_row', $mbox); $OUTPUT->show_message('folderdeleted', 'confirmation'); $OUTPUT->send(); } |
