Code Duplication    Length = 3-5 lines in 2 locations

settings/changepassword/controller.php 2 locations

@@ 139-143 (lines=5) @@
136
				\OC_JSON::error(array('data' => array(
137
					'message' => $l->t('Please provide an admin recovery password, otherwise all user data will be lost')
138
				)));
139
			} elseif ($recoveryEnabledForUser && ! $validRecoveryPassword) {
140
				\OC_JSON::error(array('data' => array(
141
					'message' => $l->t('Wrong admin recovery password. Please check the password and try again.')
142
				)));
143
			} else { // now we know that everything is fine regarding the recovery password, let's try to change the password
144
				$result = \OC_User::setPassword($username, $password, $recoveryPassword);
145
				if (!$result && $recoveryEnabledForUser) {
146
					\OC_JSON::error(array(
@@ 151-153 (lines=3) @@
148
							"message" => $l->t("Backend doesn't support password change, but the user's encryption key was successfully updated.")
149
						)
150
					));
151
				} elseif (!$result && !$recoveryEnabledForUser) {
152
					\OC_JSON::error(array("data" => array( "message" => $l->t("Unable to change password" ) )));
153
				} else {
154
					\OC_JSON::success(array("data" => array("username" => $username, 'message' => $l->t('Saved'))));
155
				}
156