if (!reloadOnly) {
setText(GT._("Login"));
LoginResult result = api.login(wiki, username, new String(password), login);
if (login) {
if ((result == null) || (!result.isLoginSuccessful())) {
throw new APIException("Login unsuccessful: " + ((result != null) ? result.toString() : ""));
}
}
User user = api.retrieveUser(wiki, username);
username = (user != null) ? user.getName() : null;
wiki.getConnection().setUser(user);