From 492d7e4c79c98836fa7898e3c203411992cb769d Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 30 Jan 2008 07:43:11 +0000 Subject: [PATCH] Enable/disable get_sub_list with configuration flag. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8644 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 801f6101d..f56bbbd42 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -757,7 +757,6 @@ function get_multiple_locks($objects) */ function get_sub_list($filter, $category,$sub_base, $base= "", $attributes= array(), $flags= GL_SUBSEARCH) { - global $config, $ui; /* Get LDAP link */ @@ -773,8 +772,12 @@ function get_sub_list($filter, $category,$sub_base, $base= "", $attributes= arra /* Remove , ("ou=1,ou=2.." => "ou=1") */ $sub_base = preg_replace("/,.*$/","",$sub_base); - /* Check if there is a sub department specified */ - if($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(). + */ + $sub_enabled = isset($config->current['SUB_LIST_SUPPORT']) && preg_match("/true/i",$config->current['SUB_LIST_SUPPORT']); + if($sub_base == "" || !$sub_enabled){ return(get_list($filter, $category,$base,$attributes,$flags)); } -- 2.30.2