summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1806a78)
raw | patch | inline | side by side (parent: 1806a78)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Feb 2008 11:25:39 +0000 (11:25 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Feb 2008 11:25:39 +0000 (11:25 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9063 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/functions.inc | patch | blob | history |
index 121ccc07563601d5d19b228884bb70bd09d97c47..a0ee267ba9a9156543e01d360e31e7310118e775 100644 (file)
function get_sub_list($filter, $category,$sub_deps, $base= "", $attributes= array(), $flags= GL_SUBSEARCH)
{
global $config, $ui;
+ $departments = array();
/* Get LDAP link */
$ldap= $config->get_ldap_link($flags & GL_SIZELIMIT);
@@ -789,17 +790,19 @@ function get_sub_list($filter, $category,$sub_deps, $base= "", $attributes= arra
}else{
/* Do NOT search within subtrees is requeste and the sub base is empty.
- * Append the current base;
+ * Append all known departments that matches the base.
*/
- if(!in_array($base,$sub_bases)){
- $sub_bases[$key] = $base;
+ foreach($config->departments as $d_base){
+ if(!in_array($d_base,$departments) && preg_match("/".normalizePreg($base)."$/",$d_base)){
+ $departments[$d_base] = $d_base;
+ }
}
}
}else{
$sub_bases[$key] = preg_replace("/,.*$/","",$sub_base);
}
}
-
+
/* Check if we have enabled the sub_dir search support AND
* if there is a sub department specified.
* If not, fall back to old method, get_list().
@@ -819,7 +822,6 @@ function get_sub_list($filter, $category,$sub_deps, $base= "", $attributes= arra
}
/* Get all deparments matching the given sub_bases */
- $departments = array();
$base_filter= "";
foreach($sub_bases as $sub_base){
$base_filter .= "(".$sub_base.")";