Code Duplication    Length = 12-12 lines in 2 locations

src/Authenticators/LDAPAuthenticator.php 2 locations

@@ 107-118 (lines=12) @@
104
            $username = $service->getUsernameByEmail($login);
105
106
            // No user found with this email.
107
            if (!$username) {
108
                if (Config::inst()->get(self::class, 'fallback_authenticator') === 'yes') {
109
                    if ($fallbackMember = $this->fallbackAuthenticate($data, $request)) {
110
                        {
111
                            return $fallbackMember;
112
                        }
113
                    }
114
                }
115
116
                $result->addError(_t('LDAPAuthenticator.INVALIDCREDENTIALS', 'Invalid credentials'));
117
                return null;
118
            }
119
        } else {
120
            $username = $login;
121
        }
@@ 125-136 (lines=12) @@
122
123
        $serviceAuthenticationResult = $service->authenticate($username, $data['Password']);
124
        $success = $serviceAuthenticationResult['success'] === true;
125
        if (!$success) {
126
            if (Config::inst()->get(self::class, 'fallback_authenticator') === 'yes') {
127
                $fallbackMember = $this->fallbackAuthenticate($data, $request);
128
                if ($fallbackMember) {
129
                    return $fallbackMember;
130
                }
131
            }
132
133
            $result->addError($serviceAuthenticationResult['message']);
134
135
            return null;
136
        }
137
138
        $data = $service->getUserByUsername($serviceAuthenticationResult['identity']);
139
        if (!$data) {