| @@ 565-573 (lines=9) @@ | ||
| 562 | } |
|
| 563 | ||
| 564 | // the user is a direct member of group with a mapping, add them to the SS group. |
|
| 565 | if ($mapping->DN == $groupDN) { |
|
| 566 | $group = $mapping->Group(); |
|
| 567 | if ($group && $group->exists()) { |
|
| 568 | $group->Members()->add($member, [ |
|
| 569 | 'IsImportedFromLDAP' => '1' |
|
| 570 | ]); |
|
| 571 | $mappedGroupIDs[] = $mapping->GroupID; |
|
| 572 | } |
|
| 573 | } |
|
| 574 | ||
| 575 | // the user *might* be a member of a nested group provided the scope of the mapping |
|
| 576 | // is to include the entire subtree. Check all those mappings and find the LDAP child groups |
|
| @@ 585-593 (lines=9) @@ | ||
| 582 | } |
|
| 583 | ||
| 584 | foreach ($childGroups as $childGroupDN => $childGroupRecord) { |
|
| 585 | if ($childGroupDN == $groupDN) { |
|
| 586 | $group = $mapping->Group(); |
|
| 587 | if ($group && $group->exists()) { |
|
| 588 | $group->Members()->add($member, [ |
|
| 589 | 'IsImportedFromLDAP' => '1' |
|
| 590 | ]); |
|
| 591 | $mappedGroupIDs[] = $mapping->GroupID; |
|
| 592 | } |
|
| 593 | } |
|
| 594 | } |
|
| 595 | } |
|
| 596 | } |
|