Code Duplication    Length = 9-9 lines in 2 locations

src/Services/LDAPService.php 2 locations

@@ 606-614 (lines=9) @@
603
                    }
604
605
                    // the user is a direct member of group with a mapping, add them to the SS group.
606
                    if ($mapping->DN == $groupDN) {
607
                        $group = $mapping->Group();
608
                        if ($group && $group->exists()) {
609
                            $group->Members()->add($member, [
610
                                'IsImportedFromLDAP' => '1'
611
                            ]);
612
                            $mappedGroupIDs[] = $mapping->GroupID;
613
                        }
614
                    }
615
616
                    // the user *might* be a member of a nested group provided the scope of the mapping
617
                    // is to include the entire subtree. Check all those mappings and find the LDAP child groups
@@ 626-634 (lines=9) @@
623
                        }
624
625
                        foreach ($childGroups as $childGroupDN => $childGroupRecord) {
626
                            if ($childGroupDN == $groupDN) {
627
                                $group = $mapping->Group();
628
                                if ($group && $group->exists()) {
629
                                    $group->Members()->add($member, [
630
                                        'IsImportedFromLDAP' => '1'
631
                                    ]);
632
                                    $mappedGroupIDs[] = $mapping->GroupID;
633
                                }
634
                            }
635
                        }
636
                    }
637
                }