Respect folder permissions and only list writeable folders (#976)
This commit is contained in:
parent
64f87cdaa0
commit
cb1712e527
2 changed files with 16 additions and 3 deletions
|
@ -84,14 +84,27 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
|
|
||||||
$name = kolab_storage::folder_displayname(kolab_storage::object_name($utf7name), $listnames);
|
$name = kolab_storage::folder_displayname(kolab_storage::object_name($utf7name), $listnames);
|
||||||
|
|
||||||
|
if ($folder->get_owner() == $_SESSION['username']) {
|
||||||
|
$readonly = false;
|
||||||
|
$alarms = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$alarms = false;
|
||||||
|
$readonly = true;
|
||||||
|
if (($rights = $folder->get_myrights()) && !PEAR::isError($rights)) {
|
||||||
|
if (strpos($rights, 'i') !== false)
|
||||||
|
$readonly = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$list_id = kolab_storage::folder_id($utf7name);
|
$list_id = kolab_storage::folder_id($utf7name);
|
||||||
$tasklist = array(
|
$tasklist = array(
|
||||||
'id' => $list_id,
|
'id' => $list_id,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'editname' => $editname,
|
'editname' => $editname,
|
||||||
'color' => 'CC0000',
|
'color' => 'CC0000',
|
||||||
'showalarms' => $prefs[$list_id]['showalarms'],
|
'showalarms' => isset($prefs[$list_id]['showalarms']) ? $prefs[$list_id]['showalarms'] : $alarms,
|
||||||
'editable' => true,
|
'editable' => !$readonly,
|
||||||
'active' => $folder->is_subscribed(kolab_storage::SERVERSIDE_SUBSCRIPTION),
|
'active' => $folder->is_subscribed(kolab_storage::SERVERSIDE_SUBSCRIPTION),
|
||||||
'parentfolder' => $path_imap,
|
'parentfolder' => $path_imap,
|
||||||
);
|
);
|
||||||
|
|
|
@ -131,7 +131,7 @@ class tasklist_ui
|
||||||
$attrib['name'] = 'list';
|
$attrib['name'] = 'list';
|
||||||
$select = new html_select($attrib);
|
$select = new html_select($attrib);
|
||||||
foreach ((array)$this->plugin->driver->get_lists() as $id => $prop) {
|
foreach ((array)$this->plugin->driver->get_lists() as $id => $prop) {
|
||||||
if (!$prop['readonly'])
|
if ($prop['editable'])
|
||||||
$select->add($prop['name'], $id);
|
$select->add($prop['name'], $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue