* Admin/ActiveDirectory: filtering user-list by groups was not implemented

This commit is contained in:
Ralf Becker 2015-04-02 08:51:58 +00:00
parent 49c53f0c30
commit ec1635c941

View File

@ -860,7 +860,7 @@ class accounts_ads
$query = ldap::quote(strtolower($param['query']));
$accounts = array();
if($param['type'] != 'groups')
if($param['type'] !== 'groups')
{
if (!empty($query) && $query != '*')
{
@ -890,6 +890,11 @@ class accounts_ads
break;
}
}
if (is_numeric($param['type']))
{
$membership_filter = '(memberOf='.$this->id2name((int)$param['type'], 'account_dn').')';
$filter = $filter ? "(&$membership_filter$filter)" : $membership_filter;
}
foreach($this->filter($filter, 'u', self::$user_attributes) as $account_id => $data)
{
$account = $this->_ldap2user($data);
@ -901,7 +906,7 @@ class accounts_ads
$accounts[$account_id] = $account;
}
}
if ($param['type'] == 'groups' || $param['type'] == 'both')
if ($param['type'] === 'groups' || $param['type'] === 'both')
{
$query = ldap::quote(strtolower($param['query']));