| @@ 640-648 (lines=9) @@ | ||
| 637 | } |
|
| 638 | ||
| 639 | // the user is a direct member of group with a mapping, add them to the SS group. |
|
| 640 | if ($mapping->DN == $groupDN) { |
|
| 641 | $group = $mapping->Group(); |
|
| 642 | if ($group && $group->exists()) { |
|
| 643 | $group->Members()->add($member, [ |
|
| 644 | 'IsImportedFromLDAP' => '1' |
|
| 645 | ]); |
|
| 646 | $mappedGroupIDs[] = $mapping->GroupID; |
|
| 647 | } |
|
| 648 | } |
|
| 649 | ||
| 650 | // the user *might* be a member of a nested group provided the scope of the mapping |
|
| 651 | // is to include the entire subtree. Check all those mappings and find the LDAP child groups |
|
| @@ 660-668 (lines=9) @@ | ||
| 657 | } |
|
| 658 | ||
| 659 | foreach ($childGroups as $childGroupDN => $childGroupRecord) { |
|
| 660 | if ($childGroupDN == $groupDN) { |
|
| 661 | $group = $mapping->Group(); |
|
| 662 | if ($group && $group->exists()) { |
|
| 663 | $group->Members()->add($member, [ |
|
| 664 | 'IsImportedFromLDAP' => '1' |
|
| 665 | ]); |
|
| 666 | $mappedGroupIDs[] = $mapping->GroupID; |
|
| 667 | } |
|
| 668 | } |
|
| 669 | } |
|
| 670 | } |
|
| 671 | } |
|