| @@ 576-584 (lines=9) @@ | ||
| 573 | } |
|
| 574 | ||
| 575 | // the user is a direct member of group with a mapping, add them to the SS group. |
|
| 576 | if ($mapping->DN == $groupDN) { |
|
| 577 | $group = $mapping->Group(); |
|
| 578 | if ($group && $group->exists()) { |
|
| 579 | $group->Members()->add($member, [ |
|
| 580 | 'IsImportedFromLDAP' => '1' |
|
| 581 | ]); |
|
| 582 | $mappedGroupIDs[] = $mapping->GroupID; |
|
| 583 | } |
|
| 584 | } |
|
| 585 | ||
| 586 | // the user *might* be a member of a nested group provided the scope of the mapping |
|
| 587 | // is to include the entire subtree. Check all those mappings and find the LDAP child groups |
|
| @@ 596-604 (lines=9) @@ | ||
| 593 | } |
|
| 594 | ||
| 595 | foreach ($childGroups as $childGroupDN => $childGroupRecord) { |
|
| 596 | if ($childGroupDN == $groupDN) { |
|
| 597 | $group = $mapping->Group(); |
|
| 598 | if ($group && $group->exists()) { |
|
| 599 | $group->Members()->add($member, [ |
|
| 600 | 'IsImportedFromLDAP' => '1' |
|
| 601 | ]); |
|
| 602 | $mappedGroupIDs[] = $mapping->GroupID; |
|
| 603 | } |
|
| 604 | } |
|
| 605 | } |
|
| 606 | } |
|
| 607 | } |
|