loginForm = null;
}
@Override
protected void event(UserRequest ureq, Component source, Event event) {
LDAPError ldapError = new LDAPError();
if (source == loginForm){
if (event == Form.EVNT_VALIDATION_OK) {
String login = loginForm.getLogin();
String pass = loginForm.getPass();
authenticatedIdentity= authenticate(login, pass, ldapError);
if (authenticatedIdentity != null) {
provider = LDAPAuthenticationController.PROVIDER_LDAP;
} else {
// try fallback to OLAT provider if configured
if (LDAPLoginModule.isCacheLDAPPwdAsOLATPwdOnLogin()) {
authenticatedIdentity = OLATAuthenticationController.authenticate(login, pass);
}
if (authenticatedIdentity != null) {
provider = OLATAuthenticationController.PROVIDER_OLAT;
}
}
// Still not found? register for hacking attempts
if (authenticatedIdentity == null) {
if (LoginModule.registerFailedLoginAttempt(login)) {
logAudit("Too many failed login attempts for " + login + ". Login blocked.", null);
getWindowControl().setError(translate("login.blocked", LoginModule.getAttackPreventionTimeoutMin().toString()));
return;
} else {
getWindowControl().setError(translate("login.error", ldapError.get()));
return;
}
}
LoginModule.clearFailedLoginAttempts(login);
// Check if disclaimer has been accepted