In folder selector show folders according to ACL (#216)

This commit is contained in:
Aleksander Machniak (Kolab Systems) 2011-07-29 15:25:50 +02:00
parent 8e78e653f3
commit 4642a4ef07

View file

@ -431,6 +431,11 @@ class rcube_kolab
$names = array();
$len = strlen($current);
if ($len && ($rpos = strrpos($current, $delim))) {
$parent = substr($current, 0, $rpos-1);
$p_len = strlen($parent);
}
// Filter folders list
foreach ($folders as $c_folder) {
$name = $c_folder->name;
@ -439,6 +444,16 @@ class rcube_kolab
continue;
}
// always show the parent of current folder
if ($p_len && $name == $parent) { }
// skip folders where user have no rights to create subfolders
else if ($c_folder->getOwner() != $_SESSION['username']) {
$rights = $c_folder->getMyRights();
if (PEAR::IsError($rights) || !preg_match('/[ck]/', $rights)) {
continue;
}
}
$names[$name] = rcube_charset_convert($name, 'UTF7-IMAP');
}