Code Duplication    Length = 9-9 lines in 2 locations

src/Services/LDAPService.php 2 locations

@@ 597-605 (lines=9) @@
594
                    }
595
596
                    // the user is a direct member of group with a mapping, add them to the SS group.
597
                    if ($mapping->DN == $groupDN) {
598
                        $group = $mapping->Group();
599
                        if ($group && $group->exists()) {
600
                            $group->Members()->add($member, [
601
                                'IsImportedFromLDAP' => '1'
602
                            ]);
603
                            $mappedGroupIDs[] = $mapping->GroupID;
604
                        }
605
                    }
606
607
                    // the user *might* be a member of a nested group provided the scope of the mapping
608
                    // is to include the entire subtree. Check all those mappings and find the LDAP child groups
@@ 617-625 (lines=9) @@
614
                        }
615
616
                        foreach ($childGroups as $childGroupDN => $childGroupRecord) {
617
                            if ($childGroupDN == $groupDN) {
618
                                $group = $mapping->Group();
619
                                if ($group && $group->exists()) {
620
                                    $group->Members()->add($member, [
621
                                        'IsImportedFromLDAP' => '1'
622
                                    ]);
623
                                    $mappedGroupIDs[] = $mapping->GroupID;
624
                                }
625
                            }
626
                        }
627
                    }
628
                }