Code Duplication    Length = 9-9 lines in 2 locations

code/services/LDAPService.php 2 locations

@@ 520-528 (lines=9) @@
517
                    }
518
519
                    // the user is a direct member of group with a mapping, add them to the SS group.
520
                    if ($mapping->DN == $groupDN) {
521
                        $group = $mapping->Group();
522
                        if ($group && $group->exists()) {
523
                            $group->Members()->add($member, array(
524
                                'IsImportedFromLDAP' => '1'
525
                            ));
526
                            $mappedGroupIDs[] = $mapping->GroupID;
527
                        }
528
                    }
529
530
                    // the user *might* be a member of a nested group provided the scope of the mapping
531
                    // is to include the entire subtree. Check all those mappings and find the LDAP child groups
@@ 540-548 (lines=9) @@
537
                        }
538
539
                        foreach ($childGroups as $childGroupDN => $childGroupRecord) {
540
                            if ($childGroupDN == $groupDN) {
541
                                $group = $mapping->Group();
542
                                if ($group && $group->exists()) {
543
                                    $group->Members()->add($member, array(
544
                                        'IsImportedFromLDAP' => '1'
545
                                    ));
546
                                    $mappedGroupIDs[] = $mapping->GroupID;
547
                                }
548
                            }
549
                        }
550
                    }
551
                }