if (searchResult != null && searchResult.length > 0) {
context.setCitizen(searchResult[0]);
context.log().info("web: ipauthentication ok");
if (context.getOriginalPathinfo().equals(loginPath)) {
throw new RedirectException(context.getSession().getId(), forwardPath);
}
return true;
}
String username = request.getParameter("webauth.username");
String password = request.getParameter("webauth.password");
context.getSession().removeAttribute("webauth.failedUser");
if (username != null && password != null && username.length() > 0) {
citizen = realm.getCitizen(username);
context.log().info("username: '"+username+"' citizen: "+citizen);
if (citizen != null && citizen.verifyCredentials(password)) {
context.setCitizen(citizen);
context.log().info("web: authentication ok");
if (context.getOriginalPathinfo().equals(loginPath)) {
throw new RedirectException(context.getSession().getId(), forwardPath);
}
return true;
} else {
context.log().info("web: no user found or wrong pass");
context.getSession().setAttribute("webauth.failedUser", username);