Code Duplication    Length = 9-9 lines in 2 locations

code/services/LDAPService.php 2 locations

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