From: hickert Date: Wed, 16 Jul 2008 06:21:34 +0000 (+0000) Subject: Updated functions.inc X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dc43e93accd4cbba7c509d879579701e48c9d3be;p=gosa.git Updated functions.inc - get_list and get_sub_list will now work with plugin acls (category/name), instead of only category acls (category) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11671 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index ada218b76..2cf169292 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -905,16 +905,14 @@ function get_sub_list($filter, $category,$sub_deps, $base= "", $attributes= arra }else{ /* Sort in every value that fits the permissions */ - if (is_array($category)){ - foreach ($category as $o){ - if ($ui->get_category_permissions($dn, $o) != ""){ - $result[]= $attrs; - break; - } - } - } else { - if ( $ui->get_category_permissions($dn, $category) != ""){ + if (!is_array($category)){ + $category = array($category); + } + foreach ($category as $o){ + if((preg_match("/\//",$o) && preg_match("/r/",$ui->get_permissions($dn,$o))) || + (!preg_match("/\//",$o) && preg_match("/r/",$ui->get_category_permissions($dn, $o)))){ $result[]= $attrs; + break; } } } @@ -975,19 +973,14 @@ function get_list($filter, $category, $base= "", $attributes= array(), $flags= G }else{ /* Sort in every value that fits the permissions */ - if (is_array($category)){ - foreach ($category as $o){ - if ($ui->get_category_permissions($dn, $o) != ""){ - - /* We found what we were looking for, break speeds things up */ - $result[]= $attrs; - } - } - } else { - if ($ui->get_category_permissions($dn, $category) != ""){ - - /* We found what we were looking for, break speeds things up */ + if (!is_array($category)){ + $category = array($category); + } + foreach ($category as $o){ + if((preg_match("/\//",$o) && preg_match("/r/",$ui->get_permissions($dn,$o))) || + (!preg_match("/\//",$o) && preg_match("/r/",$ui->get_category_permissions($dn, $o)))){ $result[]= $attrs; + break; } } }