Code Duplication    Length = 9-9 lines in 2 locations

code/forms/LDAPChangePasswordForm.php 2 locations

@@ 73-81 (lines=9) @@
70
                return $this->controller->redirect($this->controller->Link('changepassword'));
71
            }
72
            $loginResult = $service->authenticate($userData['samaccountname'], $data['OldPassword']);
73
            if (!$loginResult['success']) {
74
                $this->clearMessage();
75
                $this->sessionMessage(
76
                    _t('Member.ERRORPASSWORDNOTMATCH', "Your current password does not match, please try again"),
77
                    "bad"
78
                );
79
                // redirect back to the form, instead of using redirectBack() which could send the user elsewhere.
80
                return $this->controller->redirect($this->controller->Link('changepassword'));
81
            }
82
        }
83
84
        if (!$member) {
@@ 138-146 (lines=9) @@
135
                // redirect back to the form, instead of using redirectBack() which could send the user elsewhere.
136
                return $this->controller->redirect($this->controller->Link('changepassword'));
137
            }
138
        } else {
139
            $this->clearMessage();
140
            $this->sessionMessage(
141
                _t('Member.ERRORNEWPASSWORD', "You have entered your new password differently, try again"),
142
                "bad");
143
144
            // redirect back to the form, instead of using redirectBack() which could send the user elsewhere.
145
            return $this->controller->redirect($this->controller->Link('changepassword'));
146
        }
147
    }
148
}
149