@Override
protected void onSubmit(AjaxRequestTarget target) {
if (domain.getAddDomainToUserName()) {
login = login + "@" + domain.getDomain();
}
OmAuthenticationStrategy strategy = getAuthenticationStrategy();
WebSession ws = WebSession.get();
Type type = domain.getLdapConfigId() > 0 ? Type.ldap : Type.user;
if (ws.signIn(login, password, type, domain.getLdapConfigId())) {
setResponsePage(Application.get().getHomePage());
if (rememberMe) {
strategy.save(login, password, type, domain.getLdapConfigId());
} else {
strategy.remove();
}
} else {
strategy.remove();
if (ws.getLoginError() != null) {
ErrorValue eValue = getBean(ErrorDao.class).get(-1 * ws.getLoginError());
if (eValue != null) {
error(WebSession.getString(eValue.getFieldvalues_id()));
target.add(feedback);