From 3e3ca9c6b9c10f7e76e8443b1e04bb7f5ab85362 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Fri, 16 Nov 2018 14:51:28 +0100 Subject: [PATCH 1/2] pass domainid for list users --- .../apache/cloudstack/api/command/LdapListUsersCmd.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); From 7b63e99cc633756b56ea1e38d77310b0e4c283bb Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Mon, 19 Nov 2018 12:59:18 +0000 Subject: [PATCH 2/2] blind attempt at passing arg --- ui/scripts/ui-custom/accountsWizard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {