diff --git a/plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/api/command/LdapListUsersCmd.java b/plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/api/command/LdapListUsersCmd.java index b2266dc8fd3b..120ad7ea7ad6 100644 --- a/plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/api/command/LdapListUsersCmd.java +++ b/plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/api/command/LdapListUsersCmd.java @@ -21,6 +21,8 @@ import javax.inject.Inject; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.response.DomainResponse; import org.apache.log4j.Logger; import org.apache.cloudstack.api.APICommand; @@ -56,6 +58,9 @@ public class LdapListUsersCmd extends BaseListCmd { description = "Determines whether all ldap users are returned or just non-cloudstack users") private String listType; + @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, required = false, entityType = DomainResponse.class, description = "linked domain") + private Long domainId; + public LdapListUsersCmd() { super(); } @@ -83,7 +88,7 @@ public void execute() throws ServerApiException { List ldapResponses = null; final ListResponse response = new ListResponse(); try { - final List users = _ldapManager.getUsers(null); + final List users = _ldapManager.getUsers(domainId); ldapResponses = createLdapUserResponse(users); } catch (final NoLdapUserMatchingQueryException ex) { ldapResponses = new ArrayList(); diff --git a/ui/scripts/ui-custom/accountsWizard.js b/ui/scripts/ui-custom/accountsWizard.js index ad52fe37324f..94a323c7cae8 100644 --- a/ui/scripts/ui-custom/accountsWizard.js +++ b/ui/scripts/ui-custom/accountsWizard.js @@ -126,7 +126,7 @@ } }); $.ajax({ - url: createURL("listLdapUsers&listtype=new"), + url: createURL("listLdapUsers&listtype=new&domainid=" + args.currentData.domainid), dataType: "json", async: false, success: function(json) {