Code Duplication    Length = 11-13 lines in 2 locations

src/Authenticators/LDAPAuthenticator.php 2 locations

@@ 102-112 (lines=11) @@
99
            $username = $service->getUsernameByEmail($login);
100
101
            // No user found with this email.
102
            if (!$username) {
103
                if (Config::inst()->get('SilverStripe\\ActiveDirectory\\Authenticators\\LDAPAuthenticator', 'fallback_authenticator') === 'yes') {
104
                    $fallbackMember = self::fallback_authenticate($data, $form);
105
                    if ($fallbackMember) {
106
                        return $fallbackMember;
107
                    }
108
                }
109
110
                $form->sessionMessage(_t('LDAPAuthenticator.INVALIDCREDENTIALS', 'Invalid credentials'), 'bad');
111
                return;
112
            }
113
        } else {
114
            $username = $login;
115
        }
@@ 119-131 (lines=13) @@
116
117
        $result = $service->authenticate($username, $data['Password']);
118
        $success = $result['success'] === true;
119
        if (!$success) {
120
            if (Config::inst()->get('SilverStripe\\ActiveDirectory\\Authenticators\\LDAPAuthenticator', 'fallback_authenticator') === 'yes') {
121
                $fallbackMember = self::fallback_authenticate($data, $form);
122
                if ($fallbackMember) {
123
                    return $fallbackMember;
124
                }
125
            }
126
127
            if ($form) {
128
                $form->sessionMessage($result['message'], 'bad');
129
            }
130
            return;
131
        }
132
133
        $data = $service->getUserByUsername($result['identity']);
134
        if (!$data) {