Code Duplication    Length = 6-7 lines in 2 locations

src/Services/LDAPService.php 2 locations

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