@@ -628,10 +628,11 @@ public function searchUser(?string $searchFor, ?array $attributes = [], ?string
628
628
* @param int|null $domainKey
629
629
* @param bool $onlyActiveAccounts
630
630
* @param bool $allDomainsHaveToBeReachable
631
+ * @param string|null $baseDn
631
632
* @return array|false
632
633
* @throws ErrorException
633
634
*/
634
- public function searchGroup (?string $ searchFor , array $ groupAttributes = ['dn ' , 'member ' ], ?array $ userAttributes = ['dn ' , 'samaccountname ' , 'mail ' ], bool $ returnMembers = false , ?string $ searchFilter = "" , ?int $ domainKey = null , bool $ onlyActiveAccounts = false , bool $ allDomainsHaveToBeReachable = false )
635
+ public function searchGroup (?string $ searchFor , array $ groupAttributes = ['dn ' , 'member ' ], ?array $ userAttributes = ['dn ' , 'samaccountname ' , 'mail ' ], bool $ returnMembers = false , ?string $ searchFilter = "" , ?int $ domainKey = null , bool $ onlyActiveAccounts = false , bool $ allDomainsHaveToBeReachable = false , $ baseDn = null )
635
636
{
636
637
if (!in_array ('dn ' , $ groupAttributes )) {
637
638
$ groupAttributes [] = 'dn ' ;
@@ -641,10 +642,10 @@ public function searchGroup(?string $searchFor, array $groupAttributes = ['dn',
641
642
}
642
643
643
644
if (empty ($ searchFilter )) {
644
- $ searchFilter = "(&(objectCategory=group) (|(objectSid=%searchFor%)(cn=%searchFor%))) " ;
645
+ $ searchFilter = "(&(objectCategory=group) (|(objectSid=%searchFor%)(cn=%searchFor%)(dn=%searchFor%) )) " ;
645
646
}
646
647
647
- $ groups = $ this ->searchUser ($ searchFor , $ groupAttributes , $ searchFilter , $ domainKey , $ onlyActiveAccounts , $ allDomainsHaveToBeReachable );
648
+ $ groups = $ this ->searchUser ($ searchFor , $ groupAttributes , $ searchFilter , $ domainKey , $ onlyActiveAccounts , $ allDomainsHaveToBeReachable, $ baseDn );
648
649
649
650
if (!$ returnMembers ) {
650
651
return $ groups ;
0 commit comments