From ef588e39d5d479d06ce8424be8665cbce91140cc Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 22 Feb 2008 07:10:05 +0000 Subject: [PATCH] Updated function inc. -Fall back from get_sub_list() to get_list() fixed. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9041 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 193524d26..07990f8e2 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -784,8 +784,15 @@ function get_sub_list($filter, $category,$sub_bases, $base= "", $attributes= arr * If not, fall back to old method, get_list(). */ $sub_enabled = isset($config->current['SUB_LIST_SUPPORT']) && preg_match("/true/i",$config->current['SUB_LIST_SUPPORT']); - if($sub_bases == "" || !$sub_enabled){ - return(get_list($filter, $category,$base,$attributes,$flags)); + if(!count($sub_bases) || !$sub_enabled){ + + /* Log this fall back, it may be an unpredicted behaviour. + */ + if(!count($sub_bases)){ + gosa_log("debug","get_sub_list","",$attributes,sprintf("get_sub_list(): Falling back to get_list(), due to empty sub_bases parameter. This may slow down GOsa.",$src,$attrs['dn'])); + } + $tmp = get_list($filter, $category,$base,$attributes,$flags | GL_SUBSEARCH); + return($tmp); } /* Get all deparments matching the given sub_bases */ @@ -896,6 +903,7 @@ function get_list($filter, $category, $base= "", $attributes= array(), $flags= G $result= array(); while($attrs = $ldap->fetch()) { + $dn= $ldap->getDN(); /* Convert dn into a printable format */ -- 2.30.2