rem: sendPageAndWait("groups/members.xml", { 
add: sendPageAndWait("groups/" + groupId + "/members.xml", { 
context: function group_change_members(groupId) {    var userManager = getUserManager();    var groupManager = getGroupManager();    var group = groupManager.getGroup(groupId);        var memberArray = group.getMembers();        var groupUsers = new java.util.ArrayList();    var otherUsers = new java.util.ArrayList();    var groupMachines = new java.util.ArrayList();    var otherMachines = new java.util.ArrayList();        for (var i = 0; i < memberArray.length; i++) {    	var member = memberArray[i];    	if (member instanceof Packages.org.apache.lenya.cms.ac.User) {    		groupUsers.add(member);    	}    	if (member instanceof Packages.org.apache.lenya.cms.ac.Machine) {    		groupMachines.add(machine);    	}    }        var userIterator = userManager.getUsers();    while (userIterator.hasNext()) {    	var user = userIterator.next();    	if (!groupUsers.contains(user)) {    		otherUsers.add(user);    	}    }        while (true) {	    sendPageAndWait("groups/members.xml", {	    	"group-id" : groupId,	    	"users" : otherUsers,	    	"group-users" : groupUsers,	    	"machines" : otherMachines,	    	"group-machines" : groupMachines,	    });	    		var otherUserId = cocoon.request.get("user");		if (cocoon.request.get("add_user") && otherUserId != "") {			var user = userManager.getUser(otherUserId);			if (!groupUsers.contains(user)) {				groupUsers.add(user);				otherUsers.remove(user);			}		}	    		var groupUserId = cocoon.request.get("group_user");		if (cocoon.request.get("remove_user") && groupUserId != "") {			var user = userManager.getUser(groupUserId);			if (groupUsers.contains(user)) {				groupUsers.remove(user);				otherUsers.add(user);			}		}	    if (cocoon.request.get("cancel")) {	    	break;	    }	    		if (cocoon.request.get("submit")) {			group.removeAllMembers();						var userIterator = groupUsers.iterator();			while (userIterator.hasNext()) {				var user = userIterator.next();				group.add(user);			}						group.save();			break;		}	}   	sendPage("redirect.html", { "url" : "index.html" });}
meta: 791	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/0333865e923b06227a42e52f0caa604e7cc410e2/group-admin.js/buggy/src/webapp/lenya/content/admin/groups/group-admin.js