log.debug("do local login");
logon = new LocalLogon();
} else {
if(log.isDebugEnabled())
log.debug("do ldap login");
logon = new LdapLogon();
}
UserVO user = logon.validate(form.getLogin(), form.getPassword(), request.getRemoteAddr(), Logon.Type.WEBAPP, errors);
if((user == null || !errors.isEmpty()) && SystemConfiguration.getInstance().getBooleanValue(SystemConfiguration.Key.LDAP_AUTHENTICATION_ENABLED) && !LdapUtil.getInstance().testLdapConnection()) {