JahiaUserManagerService theService = theRegistry.getJahiaUserManagerService();
if (theService != null) {
// Check if the user has site access ( even though it is not a user of this site )
theUser = ServicesRegistry.getInstance().getJahiaUserManagerService().lookupUser(username);
if (theUser != null) {
if (theUser.verifyPassword(password)) {
if (!isAccounteLocked(theUser)) {
ok = true;
} else {
logger.warn("Login failed: account for user " + theUser.getUsername() + " is locked.");
httpServletRequest.setAttribute(VALVE_RESULT, ACCOUNT_LOCKED);