Code Duplication    Length = 9-9 lines in 2 locations

code/services/LDAPService.php 2 locations

@@ 549-557 (lines=9) @@
546
                    }
547
548
                    // the user is a direct member of group with a mapping, add them to the SS group.
549
                    if ($mapping->DN == $groupDN) {
550
                        $group = $mapping->Group();
551
                        if ($group && $group->exists()) {
552
                            $group->Members()->add($member, [
553
                                'IsImportedFromLDAP' => '1'
554
                            ]);
555
                            $mappedGroupIDs[] = $mapping->GroupID;
556
                        }
557
                    }
558
559
                    // the user *might* be a member of a nested group provided the scope of the mapping
560
                    // is to include the entire subtree. Check all those mappings and find the LDAP child groups
@@ 569-577 (lines=9) @@
566
                        }
567
568
                        foreach ($childGroups as $childGroupDN => $childGroupRecord) {
569
                            if ($childGroupDN == $groupDN) {
570
                                $group = $mapping->Group();
571
                                if ($group && $group->exists()) {
572
                                    $group->Members()->add($member, [
573
                                        'IsImportedFromLDAP' => '1'
574
                                    ]);
575
                                    $mappedGroupIDs[] = $mapping->GroupID;
576
                                }
577
                            }
578
                        }
579
                    }
580
                }