mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
sending back a account_error errorcode for trying to log into a locked account. also, changing the domainId to domainname for this error
This commit is contained in:
parent
61cf2308a1
commit
8ea2959f71
@ -180,8 +180,8 @@ public class ApiServlet extends HttpServlet {
|
||||
try {
|
||||
session.invalidate();
|
||||
}catch (IllegalStateException ise) {}
|
||||
auditTrailSb.append(" " + HttpServletResponse.SC_UNAUTHORIZED + " " + ex.getMessage() != null ? ex.getMessage() : "failed to authenticated user, check username/password are correct");
|
||||
resp.sendError(HttpServletResponse.SC_UNAUTHORIZED, ex.getMessage() != null ? ex.getMessage() : "failed to authenticated user, check username/password are correct");
|
||||
auditTrailSb.append(" " + BaseCmd.ACCOUNT_ERROR + " " + ex.getMessage() != null ? ex.getMessage() : "failed to authenticate user, check if username/password are correct");
|
||||
resp.sendError(BaseCmd.ACCOUNT_ERROR, ex.getMessage() != null ? ex.getMessage() : "failed to authenticate user, check if username/password are correct");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -605,11 +605,16 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return null;
|
||||
}
|
||||
|
||||
DomainVO domain = _domainDao.findById(domainId);
|
||||
String domainName = null;
|
||||
if(domain != null)
|
||||
domainName = domain.getName();
|
||||
|
||||
if (!userAccount.getState().equals("enabled") || !userAccount.getAccountState().equals("enabled")) {
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("user " + username + " in domain " + domainId + " is disabled/locked (or account is disabled/locked), returning null");
|
||||
s_logger.info("User " + username + " in domain " + domainName + " is disabled/locked (or account is disabled/locked)");
|
||||
}
|
||||
throw new CloudAuthenticationException("user " + username + " in domain " + domainId + " is disabled/locked (or account is disabled/locked)");
|
||||
throw new CloudAuthenticationException("User " + username + " in domain " + domainName + " is disabled/locked (or account is disabled/locked)");
|
||||
//return null;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user