Code Duplication    Length = 12-13 lines in 2 locations

src/Authenticators/LDAPChangePasswordHandler.php 2 locations

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