EPerson [] members = group.getMembers();
    protected void doDSPost(Context c,                    HttpServletRequest request, HttpServletResponse response)        throws ServletException, IOException, SQLException, AuthorizeException    {        // Find out if there's a group parameter        int groupID = UIUtil.getIntParameter(request, "group_id");        Group group = null;        if (groupID >= 0)        {            group = Group.find(c, groupID);        }        // group is set                if (group != null)        {            // is this user authorized to edit this group?            AuthorizeManager.authorizeAction(c, group, Constants.ADD);            String button = UIUtil.getSubmitButton(request, "submit");                    // just chosen a group to edit - get group and pass it to group-edit.jsp            if( button.equals("submit_edit") )            {                request.setAttribute("group", group);                request.setAttribute("members", group.getMembers());                            JSPManager.showJSP(request, response, "/tools/group-edit.jsp" );            }            // update the members of the group            else if( button.equals("submit_group_update") )            {                // first off, did we change the group name?                String newName = request.getParameter("group_name");                if( !newName.equals(group.getName()) )                {                    group.setName( newName );                    group.update();                }                 int [] eperson_ids = UIUtil.getIntParameters(request,"eperson_id");                if( eperson_ids != null )                {                    // now get members, and add new ones and remove missing ones                    EPerson [] members = group.getMembers();                    for(int x=0; x<eperson_ids.length; x++)                    {                        // look for this ID in the EPerson array                        int foundIndex = -1;                        for(int y=0; y<members.length; y++)                        {                            if((members[y]!=null) && (members[y].getID() == eperson_ids[x]))                            {                                foundIndex = y;                                break;                            }                        }                        if(foundIndex == -1)                        {                            // didn't find it, add eperson                             EPerson e   = EPerson.find(c, eperson_ids[x]);                                        group.addMember( e );                        }                        else                        {                            // found it, clear entry in members table                            members[foundIndex] = null;                        }                    }                    // now go through the members array, and any that                    // weren't set to NULL are no longer members, so remove them                    for(int y=0; y<members.length; y++)                    {                        if(members[y] != null)                        {                            group.removeMember(members[y]);                        }                    }                    group.update();                }                                        request.setAttribute("group", group);                request.setAttribute("members", group.getMembers());                JSPManager.showJSP(request, response, "/tools/group-edit.jsp" );                c.complete();            }            else if( button.equals( "submit_group_delete" ) )            {                // bogus authorize, only admins can do this                AuthorizeManager.authorizeAction(c, group, Constants.WRITE);                // delete group, return to group-list.jsp                group.delete();                            showMainPage(c, request, response);                c.complete();            }            else            {                // unknown action, show edit page                request.setAttribute("group", group);                request.setAttribute("members", group.getMembers());                JSPManager.showJSP(request, response, "/tools/group-edit.jsp" );            }        }        else  // no group set        {            // want to add a group - create a blank one, and pass to group_edit.jsp            String button = UIUtil.getSubmitButton(request, "submit");            if( button.equals( "submit_add" ) )            {                group = Group.create(c);                            group.setName("new group"+group.getID());                group.update();                            request.setAttribute("group", group);                request.setAttribute("members", group.getMembers());                JSPManager.showJSP(request, response, "/tools/group-edit.jsp" );                c.complete();            }            else            {                // show the main page (select groups)                showMainPage(c, request, response);            }        }    }