Code Duplication    Length = 9-9 lines in 2 locations

code/services/LDAPService.php 2 locations

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