Code Duplication    Length = 9-9 lines in 2 locations

src/Services/LDAPService.php 2 locations

@@ 584-592 (lines=9) @@
581
                    }
582
583
                    // the user is a direct member of group with a mapping, add them to the SS group.
584
                    if ($mapping->DN == $groupDN) {
585
                        $group = $mapping->Group();
586
                        if ($group && $group->exists()) {
587
                            $group->Members()->add($member, [
588
                                'IsImportedFromLDAP' => '1'
589
                            ]);
590
                            $mappedGroupIDs[] = $mapping->GroupID;
591
                        }
592
                    }
593
594
                    // the user *might* be a member of a nested group provided the scope of the mapping
595
                    // is to include the entire subtree. Check all those mappings and find the LDAP child groups
@@ 604-612 (lines=9) @@
601
                        }
602
603
                        foreach ($childGroups as $childGroupDN => $childGroupRecord) {
604
                            if ($childGroupDN == $groupDN) {
605
                                $group = $mapping->Group();
606
                                if ($group && $group->exists()) {
607
                                    $group->Members()->add($member, [
608
                                        'IsImportedFromLDAP' => '1'
609
                                    ]);
610
                                    $mappedGroupIDs[] = $mapping->GroupID;
611
                                }
612
                            }
613
                        }
614
                    }
615
                }