From 93a88c95b7415206b0c8d742f8914c7ecc193e11 Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 23 Sep 2009 19:01:53 +0000 Subject: [PATCH] - Prevent from setting INBOX as any of special folders (#1486114) --- CHANGELOG | 1 + plugins/archive/archive.php | 3 ++- program/include/main.inc | 5 +++-- program/steps/settings/edit_prefs.inc | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1eb7c8c6a..65aa16b36 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG RoundCube Webmail =========================== +- Prevent from setting INBOX as any of special folders (#1486114) - Fix regular expression for e-mail address (#1486152) - Fix Received header format - Implemented sorting by message index - added 'index_sort' option (#1485936) diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index 7750160c5..8c855fea7 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -115,7 +115,8 @@ class archive extends rcube_plugin $this->add_texts('localization'); $rcmail = rcmail::get_instance(); - $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, 'maxlength' => 30)); + $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, + 'maxlength' => 30, 'exceptions' => array('INBOX'))); $args['blocks']['main']['options']['archive_mbox'] = array( 'title' => $this->gettext('archivefolder'), diff --git a/program/include/main.inc b/program/include/main.inc index a99504cf5..97a3db16c 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -1152,11 +1152,12 @@ function rcmail_mailbox_select($p = array()) { global $RCMAIL; - $p += array('maxlength' => 100, 'relanames' => false); + $p += array('maxlength' => 100, 'realnames' => false); $a_mailboxes = array(); foreach ($RCMAIL->imap->list_mailboxes() as $folder) - rcmail_build_folder_tree($a_mailboxes, $folder, $RCMAIL->imap->get_hierarchy_delimiter()); + if (empty($p['exceptions']) || !in_array($folder, $p['exceptions'])) + rcmail_build_folder_tree($a_mailboxes, $folder, $RCMAIL->imap->get_hierarchy_delimiter()); $select = new html_select($p); diff --git a/program/steps/settings/edit_prefs.inc b/program/steps/settings/edit_prefs.inc index 38343b55f..6abfb00c2 100644 --- a/program/steps/settings/edit_prefs.inc +++ b/program/steps/settings/edit_prefs.inc @@ -375,7 +375,8 @@ function rcmail_user_prefs_block($part, $attrib) // Configure special folders if (!isset($no_override['default_imap_folders'])) { $RCMAIL->imap_init(true); - $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, 'maxlength' => 30)); + $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, + 'maxlength' => 30, 'exceptions' => array('INBOX'))); if (!isset($no_override['drafts_mbox'])) $blocks['main']['options']['drafts_mbox'] = array(