summaryrefslogtreecommitdiff
path: root/program/steps/settings
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-02-13 14:26:46 +0000
committeralecpl <alec@alec.pl>2012-02-13 14:26:46 +0000
commit18a3dcaf56aa8d650db8c791cdba90fcd38468ab (patch)
tree683d3369fff543f4e54a7994e2c04b1d77c7fc84 /program/steps/settings
parent06c990ead24edee69f07912f8169a0422c411422 (diff)
- Fix issue with folder creation under INBOX. namespace (#1488349)
Diffstat (limited to 'program/steps/settings')
-rw-r--r--program/steps/settings/edit_folder.inc11
-rw-r--r--program/steps/settings/folders.inc1
2 files changed, 11 insertions, 1 deletions
diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc
index 2c69c74d0..644c86e2c 100644
--- a/program/steps/settings/edit_folder.inc
+++ b/program/steps/settings/edit_folder.inc
@@ -115,6 +115,15 @@ function rcmail_folder_form($attrib)
}
else {
$selected = isset($_POST['_parent']) ? $_POST['_parent'] : $path_id;
+ $exceptions = array($mbox_imap);
+
+ // Exclude 'prefix' namespace from parent folders list (#1488349)
+ // If INBOX. namespace exists, folders created as INBOX subfolders
+ // will be listed at the same level - selecting INBOX as a parent does nothing
+ if ($prefix = $storage->get_namespace('prefix')) {
+ $exceptions[] = substr($prefix, 0, -1);
+ }
+
$select = rcmail_mailbox_select(array(
'name' => '_parent',
'noselection' => '---',
@@ -122,7 +131,7 @@ function rcmail_folder_form($attrib)
'maxlength' => 150,
'unsubscribed' => true,
'skip_noinferiors' => true,
- 'exceptions' => array($mbox_imap),
+ 'exceptions' => $exceptions,
));
$form['props']['fieldsets']['location']['content']['path'] = array(
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index d82d8366b..3802577eb 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -415,6 +415,7 @@ function rcmail_rename_folder($oldname, $newname)
$OUTPUT->set_pagetitle(rcube_label('folders'));
$OUTPUT->include_script('list.js');
$OUTPUT->set_env('quota', $STORAGE->get_capability('QUOTA'));
+$OUTPUT->set_env('prefix_ns', $STORAGE->get_namespace('prefix'));
// add some labels to client
$OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting',