Fixed editing settings of shared calendar folder (#318)

This commit is contained in:
Aleksander Machniak (Kolab Systems) 2011-08-10 19:01:09 +02:00
parent e2447a803a
commit 2138b3ed6a

View file

@ -235,17 +235,6 @@ class kolab_driver extends calendar_driver
}
}
// Check access rights to the parent folder
if (strlen($parent)) {
$this->rc->imap_connect();
$parent_opts = $this->rc->imap->mailbox_info($parent);
if ($parent_opts['namespace'] != 'personal'
&& (empty($parent_opts['rights']) || !preg_match('/[ck]/', implode($parent_opts)))
) {
return false;
}
}
if (!empty($options) && ($options['protected'] || $options['norename'])) {
$folder = $oldfolder;
}
@ -258,6 +247,17 @@ class kolab_driver extends calendar_driver
$folder = $this->rc->imap->mod_mailbox($folder, 'in');
}
// Check access rights to the parent folder
if (strlen($parent) && (!strlen($oldfolder) || $oldfolder != $folder)) {
$this->rc->imap_connect();
$parent_opts = $this->rc->imap->mailbox_info($parent);
if ($parent_opts['namespace'] != 'personal'
&& (empty($parent_opts['rights']) || !preg_match('/[ck]/', implode($parent_opts)))
) {
return false;
}
}
// update the folder name
if (strlen($oldfolder)) {
if ($oldfolder != $folder)