summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-01 07:58:30 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-01 07:58:30 +0000
commit2343a3e3f6a7e953518397a58500679676c8317d (patch)
tree39f99878473034c858bc48542d059810377245dc
parent60bd7949c0230836afa24c928b0d829148ef56e9 (diff)
- Improved detection of folder rename possibility and its handling
git-svn-id: https://svn.roundcube.net/trunk@4996 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/program/include/rcube_imap.php7
-rw-r--r--roundcubemail/program/steps/settings/edit_folder.inc40
2 files changed, 24 insertions, 23 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php
index f809288eb..3ba058988 100644
--- a/roundcubemail/program/include/rcube_imap.php
+++ b/roundcubemail/program/include/rcube_imap.php
@@ -3535,6 +3535,7 @@ class rcube_imap
$options['rights'] = $acl && !$options['is_root'] ? (array)$this->my_rights($mailbox) : array();
$options['special'] = in_array($mailbox, $this->default_folders);
+ // Set 'noselect' and 'norename' flags
if (is_array($options['options'])) {
foreach ($options['options'] as $opt) {
$opt = strtolower($opt);
@@ -3548,12 +3549,14 @@ class rcube_imap
}
if (!empty($options['rights'])) {
- $options['norename'] = !in_array('x', $options['rights']) &&
- (!in_array('c', $options['rights']) || !in_array('d', $options['rights']));
+ $options['norename'] = !in_array('x', $options['rights']);
if (!$options['noselect']) {
$options['noselect'] = !in_array('r', $options['rights']);
}
}
+ else {
+ $options['norename'] = $options['is_root'] || $options['namespace'] != 'personal';
+ }
return $options;
}
diff --git a/roundcubemail/program/steps/settings/edit_folder.inc b/roundcubemail/program/steps/settings/edit_folder.inc
index c7f61fe87..710c3ff08 100644
--- a/roundcubemail/program/steps/settings/edit_folder.inc
+++ b/roundcubemail/program/steps/settings/edit_folder.inc
@@ -106,28 +106,26 @@ function rcmail_folder_form($attrib)
),
);
- if (strlen($path) || !strlen($mbox)) {
- if (!empty($options) && ($options['norename'] || $options['namespace'] != 'personal')) {
- // prevent user from moving folder
- $hidden_path = new html_hiddenfield(array('name' => '_parent', 'value' => $path));
- $form['props']['fieldsets']['location']['content']['name']['value'] .= $hidden_path->show();
- }
- else {
- $selected = isset($_POST['_parent']) ? $_POST['_parent'] : $path_id;
- $select = rcmail_mailbox_select(array(
- 'name' => '_parent',
- 'noselection' => '---',
- 'realnames' => false,
- 'maxlength' => 150,
- 'unsubscribed' => true,
- 'exceptions' => array($mbox_imap),
- ));
+ if (!empty($options) && ($options['norename'] || $options['protected'])) {
+ // prevent user from moving folder
+ $hidden_path = new html_hiddenfield(array('name' => '_parent', 'value' => $path));
+ $form['props']['fieldsets']['location']['content']['name']['value'] .= $hidden_path->show();
+ }
+ else {
+ $selected = isset($_POST['_parent']) ? $_POST['_parent'] : $path_id;
+ $select = rcmail_mailbox_select(array(
+ 'name' => '_parent',
+ 'noselection' => '---',
+ 'realnames' => false,
+ 'maxlength' => 150,
+ 'unsubscribed' => true,
+ 'exceptions' => array($mbox_imap),
+ ));
- $form['props']['fieldsets']['location']['content']['path'] = array(
- 'label' => rcube_label('parentfolder'),
- 'value' => $select->show($selected),
- );
- }
+ $form['props']['fieldsets']['location']['content']['path'] = array(
+ 'label' => rcube_label('parentfolder'),
+ 'value' => $select->show($selected),
+ );
}
// Settings