- Fix handling of other users namespace roots

release-0.6
alecpl 14 years ago
parent 1564d4ef79
commit 9220169bf1

@ -3508,12 +3508,25 @@ class rcube_imap
foreach ($ns as $item) {
if ($item[0] === $mbox) {
$options['is_root'] = true;
break;
break 2;
}
}
}
}
}
// check if the folder is other user virtual-root
if (!$options['is_root'] && !empty($namespace) && !empty($namespace['other'])) {
$parts = explode($this->delimiter, $mailbox);
if (count($parts) == 2) {
$mbox = $parts[0] . $this->delimiter;
foreach ($namespace['other'] as $item) {
if ($item[0] === $mbox) {
$options['is_root'] = true;
break;
}
}
}
}
$options['name'] = $mailbox;
$options['options'] = $this->mailbox_options($mailbox, true);

@ -79,7 +79,7 @@ function rcmail_folder_form($attrib)
// Location (name)
if ($options['protected']) {
$foldername = Q(rcmail_localize_foldername($mbox_imap));
$foldername = Q(str_replace($delimiter, ' » ', rcmail_localize_folderpath($mbox_imap)));
}
else if ($options['norename']) {
$foldername = Q($folder);

@ -280,11 +280,24 @@ function rcube_subscription_form($attrib)
foreach ($ns as $item) {
if ($item[0] === $fname) {
$disabled = true;
break;
break 2;
}
}
}
}
// check if the folder is an other users virtual-root folder, then disable subscription option on it
if (!$disabled && $folder['virtual'] && $folder['level'] == 1
&& !empty($namespace) && !empty($namespace['other'])
) {
$parts = explode($delimiter, $folder['id']);
$fname = $parts[0] . $delimiter;
foreach ($namespace['other'] as $item) {
if ($item[0] === $fname) {
$disabled = true;
break;
}
}
}
$table->add_row(array('id' => 'rcmrow'.$idx, 'class' => join(' ', $classes),
'foldername' => $folder['id']));

Loading…
Cancel
Save