Code Duplication    Length = 9-9 lines in 2 locations

src/Services/LDAPService.php 2 locations

@@ 617-625 (lines=9) @@
614
                    }
615
616
                    // the user is a direct member of group with a mapping, add them to the SS group.
617
                    if ($mapping->DN == $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
                    // the user *might* be a member of a nested group provided the scope of the mapping
628
                    // is to include the entire subtree. Check all those mappings and find the LDAP child groups
@@ 637-645 (lines=9) @@
634
                        }
635
636
                        foreach ($childGroups as $childGroupDN => $childGroupRecord) {
637
                            if ($childGroupDN == $groupDN) {
638
                                $group = $mapping->Group();
639
                                if ($group && $group->exists()) {
640
                                    $group->Members()->add($member, [
641
                                        'IsImportedFromLDAP' => '1'
642
                                    ]);
643
                                    $mappedGroupIDs[] = $mapping->GroupID;
644
                                }
645
                            }
646
                        }
647
                    }
648
                }