summaryrefslogtreecommitdiff
path: root/program/steps/settings/save_folder.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-08-19 08:07:05 +0000
committeralecpl <alec@alec.pl>2011-08-19 08:07:05 +0000
commitdd6a47c24a5546dc40c083700af16efcfe6154cf (patch)
treee0ab40f6bf5db5f0f60f1c67cb116cb0dbf084b5 /program/steps/settings/save_folder.inc
parent2ce8e5dd94246e9c0bd0b2dd795cc779d1ef766a (diff)
- Fix parent folder ACL checking in some cases
Diffstat (limited to 'program/steps/settings/save_folder.inc')
-rw-r--r--program/steps/settings/save_folder.inc22
1 files changed, 12 insertions, 10 deletions
diff --git a/program/steps/settings/save_folder.inc b/program/steps/settings/save_folder.inc
index 2f515627d..48c957239 100644
--- a/program/steps/settings/save_folder.inc
+++ b/program/steps/settings/save_folder.inc
@@ -55,16 +55,6 @@ else {
}
}
-// Check access rights to the parent folder
-if (!$error && strlen($path)) {
- $parent_opts = $RCMAIL->imap->mailbox_info($path);
- if ($parent_opts['namespace'] != 'personal'
- && (empty($parent_opts['rights']) || !preg_match('/[ck]/', implode($parent_opts)))
- ) {
- $error = rcube_label('parentnotwritable');
- }
-}
-
if ($error) {
$OUTPUT->command('display_message', $error, 'error');
}
@@ -78,7 +68,19 @@ else {
else {
$name_imap = $RCMAIL->imap->mod_mailbox($name_imap, 'in');
}
+}
+
+// Check access rights to the parent folder
+if (!$error && strlen($path) && (!strlen($old_imap) || $old_imap != $name_imap)) {
+ $parent_opts = $RCMAIL->imap->mailbox_info($path);
+ if ($parent_opts['namespace'] != 'personal'
+ && (empty($parent_opts['rights']) || !preg_match('/[ck]/', implode($parent_opts)))
+ ) {
+ $error = rcube_label('parentnotwritable');
+ }
+}
+if (!$error) {
$folder['name'] = $name_imap;
$folder['oldname'] = $old_imap;
$folder['class'] = '';