improve user listing method

application-manager-new
Rasika Perera 9 years ago
parent a726beb345
commit f64ff853d0

@ -256,15 +256,14 @@ userModule = function () {
var server = new carbon.server.Server(url); var server = new carbon.server.Server(url);
var userManager = new carbon.user.UserManager(server, tenantId); var userManager = new carbon.user.UserManager(server, tenantId);
var userList = userManager.listUsers(); var userList = userManager.listUsers();
var i, userObject, email, firstname, lastname; var i, username, userObject, email, firstname, lastname;
for (i = 0; i < userList.length; i++) { for (i = 0; i < userList.length; i++) {
userObject = userManager.getUser(userList[i]); username = userList[i];
email = userManager.getClaim(userList[i],"http://wso2.org/claims/emailaddress", null); userObject = userManager.getUser(username);
firstname = userManager.getClaim(userList[i],"http://wso2.org/claims/givenname", null); email = userManager.getClaim(username,"http://wso2.org/claims/emailaddress", null);
lastname = userManager.getClaim(userList[i],"http://wso2.org/claims/lastname", null); firstname = userManager.getClaim(username,"http://wso2.org/claims/givenname", null);
//log.info(userManager.getClaimsForSet(userList[i], new Array("http://wso2.org/claims/emailaddress", lastname = userManager.getClaim(username,"http://wso2.org/claims/lastname", null);
// "http://wso2.org/claims/givenname", //log.info(userManager.getClaimsForSet(username, "http://wso2.org/claims/emailaddress,http://wso2.org/claims/givenname,http://wso2.org/claims/lastname".split(","), null));
// "http://wso2.org/claims/lastname"), null));
userObj = { userObj = {
"username" : userObject.username, "username" : userObject.username,
"email" : email, "email" : email,

Loading…
Cancel
Save