From 1121a4b715b5feaa8fcdd86de09bdddf90957f0e Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 19 Mar 2010 08:40:29 +0000 Subject: [PATCH] Updated autocompletion in 2.6 - Take care of object permissions (requires 'objectClass' in the list of requested attributes) - Fixed typo in autocomplete generation, maxlength wasn't replaced by {$maxlength} git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@16945 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_filter.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gosa-core/include/class_filter.inc b/gosa-core/include/class_filter.inc index cd9aa8dd7..76c794911 100644 --- a/gosa-core/include/class_filter.inc +++ b/gosa-core/include/class_filter.inc @@ -148,7 +148,7 @@ class filter { if (isset($element['maxlength'])){ $maxlength= $element['maxlength']; } - $result= ""; + $result= ""; if (isset($element['autocomplete'])) { $frequency= "0.5"; $characters= "1"; @@ -392,6 +392,9 @@ class filter { $filter= $query['filter']; $attributes= $query['attribute']; + // ObjectClass is required to check permissions later. + if(!in_array('objectClass', $attributes)) $attributes[] = 'objectClass'; + // Generate final filter foreach ($this->elements as $tag => $element) { if (!isset($element['set']) || !isset($element['unset'])) { @@ -490,13 +493,16 @@ class filter { $attributes= array($attributes); } + // ObjectClass is required to check permissions later. + if(!in_array('objectClass', $attributes)) $attributes[] = 'objectClass'; + // Make filter $filter= preg_replace("/\\$$tag/", normalizeLdap($value), $filter); if (isset($config['base']) && isset($config['scope']) && isset($config['category'])) { - $result= call_user_func(array($backend, 'query'), $config['base'], $config['scope'], $filter, $attributes, + $result= call_user_func(array($backend, 'query'), $this,$config['base'], $config['scope'], $filter, $attributes, $config["category"], $config["objectStorage"]); } else { - $result= call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, + $result= call_user_func(array($backend, 'query'), $this,$this->base, $this->scope, $filter, $attributes, $this->category, $this->objectStorage); } -- 2.30.2