Code Duplication    Length = 6-7 lines in 2 locations

src/Services/LDAPService.php 2 locations

@@ 177-183 (lines=7) @@
174
        $message = $messages[0]; // first message is user readable, suitable for showing on login form
175
176
        // show better errors than the defaults for various status codes returned by LDAP
177
        if (!empty($messages[1]) && strpos($messages[1], 'NT_STATUS_ACCOUNT_LOCKED_OUT') !== false) {
178
            $message = _t(
179
                'LDAPService.ACCOUNTLOCKEDOUT',
180
                'Your account has been temporarily locked because of too many failed login attempts. ' .
181
                'Please try again later.'
182
            );
183
        }
184
        if (!empty($messages[1]) && strpos($messages[1], 'NT_STATUS_LOGON_FAILURE') !== false) {
185
            $message = _t(
186
                'LDAPService.INVALIDCREDENTIALS',
@@ 184-189 (lines=6) @@
181
                'Please try again later.'
182
            );
183
        }
184
        if (!empty($messages[1]) && strpos($messages[1], 'NT_STATUS_LOGON_FAILURE') !== false) {
185
            $message = _t(
186
                'LDAPService.INVALIDCREDENTIALS',
187
                'The provided details don\'t seem to be correct. Please try again.'
188
            );
189
        }
190
191
        return [
192
            'success' => $result->getCode() === 1,