summaryrefslogtreecommitdiff
path: root/program
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
parent06c990ead24edee69f07912f8169a0422c411422 (diff)
- Fix issue with folder creation under INBOX. namespace (#1488349)
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js8
-rw-r--r--program/steps/settings/edit_folder.inc11
-rw-r--r--program/steps/settings/folders.inc1
3 files changed, 17 insertions, 3 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 208e9b489..ad0cc9096 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -4984,7 +4984,7 @@ function rcube_webmail()
if (!this.gui_objects.subscriptionlist)
return false;
- var row, n, i, tmp, folders, rowid, list = [], slist = [],
+ var row, n, i, tmp, tmp_name, folders, rowid, list = [], slist = [],
tbody = this.gui_objects.subscriptionlist.tBodies[0],
refrow = $('tr', tbody).get(1),
id = 'rcmrow'+((new Date).getTime());
@@ -5020,8 +5020,12 @@ function rcube_webmail()
for (n in folders) {
// protected folder
if (folders[n][2]) {
+ tmp_name = folders[n][0] + this.env.delimiter;
+ // prefix namespace cannot have subfolders (#1488349)
+ if (tmp_name == this.env.prefix_ns)
+ continue;
slist.push(folders[n][0]);
- tmp = folders[n][0]+this.env.delimiter;
+ tmp = tmp_name;
}
// protected folder's child
else if (tmp && folders[n][0].indexOf(tmp) == 0)
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',