From: hickert Date: Tue, 5 Jan 2010 10:10:55 +0000 (+0000) Subject: Enabled autocompleter for opsiLicenses X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9a192058b2b0019fbd7f76493de311564edccfc2;p=gosa.git Enabled autocompleter for opsiLicenses git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15046 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_filterOpsiLicense.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_filterOpsiLicense.inc index 368aeafb6..e2998f61a 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_filterOpsiLicense.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_filterOpsiLicense.inc @@ -3,6 +3,25 @@ class filterOpsiLicense { static function query($base, $scope, $filter, $attributes, $category, $objectStorage= "") + { + $config= session::global_get('config'); + $ldap= $config->get_ldap_link(TRUE); + $flag= ($scope == "sub")?GL_SUBSEARCH:0; + $result= filterOpsiLicense::get_list($base, $filter, $attributes, $category, $objectStorage, $flag); + + // Simple filtering + if(!empty($filter)){ + foreach($result as $key => $entry){ + if(!preg_match($filter, $entry['cn'][0])){ + unset($result[$key]); + } + } + } + + return(filterACL::unifyResult($result)); + } + + static function get_list($base, $filter, $attributes, $category, $objectStorage, $flags= GL_SUBSEARCH) { $config= session::global_get('config'); $si = new opsiLicenceHandler($config); @@ -30,7 +49,7 @@ class filterOpsiLicense { $result[] = $entry; } } - return(filterACL::unifyResult($result)); + return($result); } static function unifyResult($result) diff --git a/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.xml b/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.xml index 220ee4025..7abcde7e6 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.xml +++ b/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.xml @@ -10,7 +10,7 @@ OpsiLicense - (&(objectClass=fake_opsiLicense)$NAME) + $NAME dn objectClass cn @@ -26,11 +26,11 @@ 60 - (cn=*$*) + /$/i false OpsiLicense - (&(objectClass=fake_opsiLicense)(cn=*$NAME*)) + /$NAME/i cn 0.5 3