"fixed not / only partialy working lettersearch in Admin >> Manage groups"

This commit is contained in:
Ralf Becker 2009-04-23 06:25:58 +00:00
parent acc4f5030e
commit c438279e03

View File

@ -716,9 +716,12 @@ class accounts_ldap
// if we do not have a start, or want the members of a certain group, we want all, that way we dont want to or the uids // if we do not have a start, or want the members of a certain group, we want all, that way we dont want to or the uids
// since if we have a whole lot of members, it slows the query down // since if we have a whole lot of members, it slows the query down
// if you work with very big groups, it may present a problem // if you work with very big groups, it may present a problem
if (is_numeric($start) || is_numeric($param['type'])) { if (is_numeric($start) || is_numeric($param['type']))
{
$filter = "(" . "&(objectclass=posixaccount)" . '(|(uid='.implode(')(uid=',$relevantAccounts).'))' . $this->account_filter . ")"; $filter = "(" . "&(objectclass=posixaccount)" . '(|(uid='.implode(')(uid=',$relevantAccounts).'))' . $this->account_filter . ")";
} else { }
else
{
$filter = "(" . "&(objectclass=posixaccount)" . $this->account_filter . ")"; $filter = "(" . "&(objectclass=posixaccount)" . $this->account_filter . ")";
} }
@ -759,7 +762,19 @@ class accounts_ldap
} }
else else
{ {
$filter = "(&(objectclass=posixgroup)(cn=*$query*))"; switch($param['query_type'])
{
case 'all':
default:
$query = '*'.$query;
// fall-through
case 'start':
$query .= '*';
// fall-through
case 'exact':
break;
}
$filter = "(&(objectclass=posixgroup)(cn=$query))";
} }
$sri = ldap_search($this->ds, $this->group_context, $filter,array('cn','gidNumber')); $sri = ldap_search($this->ds, $this->group_context, $filter,array('cn','gidNumber'));
$allValues = ldap_get_entries($this->ds, $sri); $allValues = ldap_get_entries($this->ds, $sri);