X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_filter.inc;h=2afa3fe60685fe2e85029debd50dcb29552e9c1c;hb=5ab7ebd28e53d52c3e6f3eddebde408550226ec2;hp=5f2d94ec64750d0cc840e3196c0dd76e033d5d05;hpb=c2e8f07cad56859137daa1d5351affcda02df86d;p=gosa.git diff --git a/gosa-core/include/class_filter.inc b/gosa-core/include/class_filter.inc index 5f2d94ec6..2afa3fe60 100644 --- a/gosa-core/include/class_filter.inc +++ b/gosa-core/include/class_filter.inc @@ -25,6 +25,9 @@ class filter { var $xmlData; var $searches= array(); var $search; + + #FIXME - Seems to be obsolete. Categories are defined in the listing.xml + # and not in the filter.xml anymore. var $category= ""; var $objectStorage= array(); var $base= ""; @@ -36,6 +39,16 @@ class filter { var $converter= null; var $pid; + /* An editor which allows to create user defined ldap-filter. + * Due to the fact that it requires additional ldap schemata + * (objectClasses=gosaProperties) this is currently optional. + */ + var $filterEditor = NULL; + + /* The categories this filter is made for (e.g. ['users'] or. ['server','workstation']). + * Since this is set we are able to create user defined filters. + */ + var $categories = array(); function filter($filename) { @@ -267,7 +280,7 @@ class filter { $filter= preg_replace("/\\$/", "*".normalizeLdap($this->value)."*", $filter); } - $result= array_merge($result, call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, $this->category, $this->objectStorage)); + $result= array_merge($result, call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, $this->categories, $this->objectStorage)); } return ($result); @@ -317,7 +330,7 @@ class filter { $config["category"], $config["objectStorage"]); } else { $result= call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, - $this->category, $this->objectStorage); + $this->categories, $this->objectStorage); } foreach ($result as $entry) { @@ -398,6 +411,7 @@ class filter { // Build ul/li list $result.= "
$script"; } + + + function setCategories($categories) + { + if(!is_array($categories) && !empty($categories)){ + $categories = array($categories) ; + } + $this->categories = $categories; + } }