From: cajus Date: Mon, 22 Feb 2010 08:40:27 +0000 (+0000) Subject: Workarounded filter for empty RDN settings X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e49fdd3860bd518bf3210c9f0f76c3f0961d621c;p=gosa.git Workarounded filter for empty RDN settings git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15659 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_filterLDAP.inc b/gosa-core/include/class_filterLDAP.inc index 8375a3832..34aff04a8 100644 --- a/gosa-core/include/class_filterLDAP.inc +++ b/gosa-core/include/class_filterLDAP.inc @@ -2,7 +2,7 @@ class filterLDAP { - static function query($base, $scope, $filter, $attributes, $category, $objectStorage= "") + static function query($base, $scope, $filter, $attributes, $category, $objectStorage= array("")) { $config= session::global_get('config'); $ldap= $config->get_ldap_link(TRUE); @@ -21,16 +21,17 @@ class filterLDAP { if (!is_array($category)) { $category= array($category); } - if (!is_array($objectStorage)) { - $objectStorage= array($objectStorage); - } - $method= (empty($objectStorage) && !($flags & GL_SUBSEARCH))?"ls":"search"; + + // Store in base - i.e. is a rdn value empty? + $storeOnBase= count($objectStorage) == 1 && empty($objectStorage[0]); + + $method= ($storeOnBase && !($flags & GL_SUBSEARCH))?"ls":"search"; // Initialize search bases $bases= array(); // Get list of sub bases to search on - if (count($objectStorage) == 0) { + if ($storeOnBase) { $bases[$base]= ""; } else { foreach ($objectStorage as $oc) {