Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.EnumUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -531,7 +532,7 @@ public ListResponse<UserResponse> searchForUsers(Long domainId, boolean recursiv
Object type = null;
String accountName = null;
Object state = null;
Object keyword = null;
String keyword = null;

Pair<List<UserAccountJoinVO>, Integer> result = getUserListInternal(caller, permittedAccounts, listAll, id, username, type, accountName, state, keyword, domainId, recursive,
null);
Expand Down Expand Up @@ -560,7 +561,7 @@ private Pair<List<UserAccountJoinVO>, Integer> searchForUsersInternal(ListUsersC
Object type = cmd.getAccountType();
String accountName = cmd.getAccountName();
Object state = cmd.getState();
Object keyword = cmd.getKeyword();
String keyword = cmd.getKeyword();

Long domainId = cmd.getDomainId();
boolean recursive = cmd.isRecursive();
Expand All @@ -573,7 +574,7 @@ private Pair<List<UserAccountJoinVO>, Integer> searchForUsersInternal(ListUsersC
}

private Pair<List<UserAccountJoinVO>, Integer> getUserListInternal(Account caller, List<Long> permittedAccounts, boolean listAll, Long id, Object username, Object type,
String accountName, Object state, Object keyword, Long domainId, boolean recursive, Filter searchFilter) {
String accountName, Object state, String keyword, Long domainId, boolean recursive, Filter searchFilter) {
Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<Long, Boolean, ListProjectResourcesCriteria>(domainId, recursive, null);
_accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedAccounts, domainIdRecursiveListProject, listAll, false);
domainId = domainIdRecursiveListProject.first();
Expand Down Expand Up @@ -617,7 +618,9 @@ private Pair<List<UserAccountJoinVO>, Integer> getUserListInternal(Account calle
ssc.addOr("email", Op.LIKE, "%" + keyword + "%");
ssc.addOr("state", Op.LIKE, "%" + keyword + "%");
ssc.addOr("accountName", Op.LIKE, "%" + keyword + "%");
ssc.addOr("accountType", Op.LIKE, "%" + keyword + "%");
if (EnumUtils.isValidEnum(Account.Type.class, keyword.toUpperCase())) {
ssc.addOr("accountType", Op.EQ, EnumUtils.getEnum(Account.Type.class, keyword.toUpperCase()));
}

sc.addAnd("username", Op.SC, ssc);
}
Expand Down