summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-03-19 13:47:47 +0000
committeralecpl <alec@alec.pl>2010-03-19 13:47:47 +0000
commit02f7cb88515d1dba3ed84468dded23d04cd2b889 (patch)
tree5dbb0c5ff2cb408f6e8b6973c52d57d695b567cb /program/include
parent9b3fdc25c171d2b2461af42224ea16ad6c032c49 (diff)
- Fix rcube_imap::mailbox_exists (#1486560)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_imap.php26
1 files changed, 12 insertions, 14 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 651ecd61c..44d23cc69 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2167,7 +2167,7 @@ class rcube_imap
$mailbox = $this->mod_mailbox($mbox_name);
// make sure mailbox exists
- if ($mailbox == 'INBOX' || $this->mailbox_exists($mbox_name)) {
+ if ($this->mailbox_exists($mbox_name, true)) {
if ($is_file) {
$separator = rcmail::get_instance()->config->header_delimiter();
$saved = iil_C_AppendFromFile($this->conn, $mailbox, $message,
@@ -2210,7 +2210,7 @@ class rcube_imap
return false;
// make sure mailbox exists
- if ($to_mbox != 'INBOX' && !$this->mailbox_exists($tbox))
+ if ($to_mbox != 'INBOX' && !$this->mailbox_exists($tbox, true))
{
if (in_array($tbox, $this->default_folders))
$this->create_mailbox($tbox, true);
@@ -2292,7 +2292,7 @@ class rcube_imap
return false;
// make sure mailbox exists
- if ($to_mbox != 'INBOX' && !$this->mailbox_exists($tbox))
+ if ($to_mbox != 'INBOX' && !$this->mailbox_exists($tbox, true))
{
if (in_array($tbox, $this->default_folders))
$this->create_mailbox($tbox, true);
@@ -2620,7 +2620,7 @@ class rcube_imap
{
$mailbox = $this->mod_mailbox($mbox_name);
$sub_mboxes = iil_C_ListMailboxes($this->conn, $this->mod_mailbox(''),
- $mailbox . $this->delimiter . '*');
+ $mbox_name . $this->delimiter . '*');
// unsubscribe mailbox before deleting
iil_C_UnSubscribe($this->conn, $mailbox);
@@ -2634,11 +2634,11 @@ class rcube_imap
foreach ($sub_mboxes as $c_mbox)
if ($c_mbox != 'INBOX') {
- iil_C_UnSubscribe($this->conn, $c_mbox);
- $result = iil_C_DeleteFolder($this->conn, $c_mbox);
- if ($result >= 0) {
- $deleted = true;
- $this->clear_message_cache($c_mbox.'.msg');
+ iil_C_UnSubscribe($this->conn, $c_mbox);
+ $result = iil_C_DeleteFolder($this->conn, $c_mbox);
+ if ($result >= 0) {
+ $deleted = true;
+ $this->clear_message_cache($c_mbox.'.msg');
}
}
}
@@ -2680,16 +2680,14 @@ class rcube_imap
if ($mbox_name == 'INBOX')
return true;
- $mbox = $this->mod_mailbox($mbox_name);
-
if ($subscription) {
- if ($a_folders = iil_C_ListSubscribed($this->conn, $this->mod_mailbox(''), $mbox))
+ if ($a_folders = iil_C_ListSubscribed($this->conn, $this->mod_mailbox(''), $mbox_name))
return true;
}
else {
- $a_folders = iil_C_ListMailboxes($this->conn, $this->mod_mailbox(''), $mbox);
+ $a_folders = iil_C_ListMailboxes($this->conn, $this->mod_mailbox(''), $mbox_mbox);
- if (is_array($a_folders) && in_array($mbox, $a_folders))
+ if (is_array($a_folders) && in_array($this->mod_mailbox($mbox_name), $a_folders))
return true;
}
}