- Improved detection of folder rename possibility and its handling
| | |
| | | $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); |
| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | |
| | | ), |
| | | ); |
| | | |
| | | if (strlen($path) || !strlen($mbox)) { |
| | | if (!empty($options) && ($options['norename'] || $options['namespace'] != 'personal')) { |
| | | 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(); |
| | |
| | | 'label' => rcube_label('parentfolder'), |
| | | 'value' => $select->show($selected), |
| | | ); |
| | | } |
| | | } |
| | | |
| | | // Settings |