rem: cocoon.sendPage("redirect.html", { "url" : redirectUri }); 
add: cocoon.redirectTo(redirectUri); 
context: function userChangeGroups() {	resolve();	try {	    var redirectUri = getRequestUri();        var userId = getAccreditableId();			var groupManager = getAccreditableManager().getGroupManager();	    var user = getAccreditableManager().getUserManager().getUser(userId);	    	    var userGroupArray = user.getGroups();	    var userGroups = new java.util.ArrayList(java.util.Arrays.asList(userGroupArray));	    	    var groupArray = getAccreditableManager().getGroupManager().getGroups();	    var groups = new java.util.ArrayList(java.util.Arrays.asList(groupArray));	    groups.removeAll(userGroups);	    var ready = false;	    while (!ready) {		    cocoon.sendPageAndWait("users/groups.xml", {		    	"user-id" : userId,		    	"groups" : groups,		    	"user-groups" : userGroups		    });		    			var groupId = cocoon.request.get("group");			if (cocoon.request.get("add_group") && groupId != null) {				var group = groupManager.getGroup(groupId);				if (!userGroups.contains(group)) {					userGroups.add(group);					groups.remove(group);				}			}		    			var userGroupId = cocoon.request.get("user_group");			if (cocoon.request.get("remove_group") && userGroupId != null) {				var group = groupManager.getGroup(userGroupId);				if (userGroups.contains(group)) {					userGroups.remove(group);					groups.add(group);				}			}				if (cocoon.request.get("submit")) {				user.removeFromAllGroups();		var testGroups = groupManager.getGroups();        for (i = 0; i < testGroups.length; i++) {            if (testGroups[i].contains(user)) throw new Packages.java.lang.Exception(group + ":" + user);        }				var iterator = userGroups.iterator();				while (iterator.hasNext()) {					var group = iterator.next();										if (group.contains(user)) throw new Packages.java.lang.Exception(group + "-" + user);										group.add(user);				}				user.save();				ready = true;			}			else if (cocoon.request.get("cancel")) {			    ready = true;			}		}	   	cocoon.sendPage("redirect.html", { "url" : redirectUri });   	}   	finally {   		release();   	}}
meta: 791	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/5b9c6ae2fb641effa76e35efe68abb2bee660da7/user-admin.js/buggy/src/webapp/lenya/content/admin/users/user-admin.js