* ActiveDirectory: primary group was not used when filtering accounts by a group, causing eg. no accounts to be found for "Domain Users" group in Admin or other apps

This commit is contained in:
Ralf Becker 2015-04-09 09:45:36 +00:00
parent d8374eaa87
commit 75bbe05335

View File

@ -892,7 +892,7 @@ class accounts_ads
} }
if (is_numeric($param['type'])) if (is_numeric($param['type']))
{ {
$membership_filter = '(memberOf='.$this->id2name((int)$param['type'], 'account_dn').')'; $membership_filter = '(|(memberOf='.$this->id2name((int)$param['type'], 'account_dn').')(PrimaryGroupId='.abs($param['type']).'))';
$filter = $filter ? "(&$membership_filter$filter)" : $membership_filter; $filter = $filter ? "(&$membership_filter$filter)" : $membership_filter;
} }
foreach($this->filter($filter, 'u', self::$user_attributes) as $account_id => $data) foreach($this->filter($filter, 'u', self::$user_attributes) as $account_id => $data)