Code Duplication    Length = 12-13 lines in 2 locations

src/Authenticators/LDAPChangePasswordHandler.php 2 locations

@@ 69-80 (lines=12) @@
66
                return $form->getController()->redirect($form->getController()->Link('changepassword'));
67
            }
68
            $loginResult = $service->authenticate($userData['samaccountname'], $data['OldPassword']);
69
            if (!$loginResult['success']) {
70
                $form->clearMessage();
71
                $form->sessionMessage(
72
                    _t(
73
                        'SilverStripe\\Security\\Member.ERRORPASSWORDNOTMATCH',
74
                        'Your current password does not match, please try again'
75
                    ),
76
                    'bad'
77
                );
78
                // redirect back to the form, instead of using redirectBack() which could send the user elsewhere.
79
                return $form->getController()->redirect($form->getController()->Link('changepassword'));
80
            }
81
        }
82
83
        if (!$member) {
@@ 150-162 (lines=13) @@
147
                // redirect back to the form, instead of using redirectBack() which could send the user elsewhere.
148
                return $form->getController()->redirect($form->getController()->Link('changepassword'));
149
            }
150
        } else {
151
            $form->clearMessage();
152
            $form->sessionMessage(
153
                _t(
154
                    'SilverStripe\\Security\\Member.ERRORNEWPASSWORD',
155
                    'You have entered your new password differently, try again'
156
                ),
157
                'bad'
158
            );
159
160
            // redirect back to the form, instead of using redirectBack() which could send the user elsewhere.
161
            return $form->getController()->redirect($form->getController()->Link('changepassword'));
162
        }
163
    }
164
}
165