Update of 
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms
In directory 
james.mmbase.org:/tmp/cvs-serv17947/java/com/finalist/cmsc/community/forms

Modified Files:
        DeleteUserAction.java SearchConditionalUserAction.java 
Log Message:
CMSC-996,User and Group lists in Editors,add delete user's forward


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms
See also: http://www.mmbase.org/jira/browse/CMSC-996


Index: DeleteUserAction.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms/DeleteUserAction.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- DeleteUserAction.java       10 May 2008 16:31:49 -0000      1.5
+++ DeleteUserAction.java       5 Aug 2008 05:44:37 -0000       1.6
@@ -16,16 +16,35 @@
 public class DeleteUserAction extends AbstractCommunityAction {
 
     protected static final String AUTHENTICATION_ID = "authid";
+    protected static final String FORWARD_GROUP = "group";
 
        @Override
        public ActionForward execute(ActionMapping mapping, ActionForm 
actionForm, HttpServletRequest request,
                        HttpServletResponse httpServletResponse) throws 
Exception {
+               String path=request.getParameter(FORWARD_GROUP);
+               deleteUser(request);
+               if (null==path||",".equals(path)) {
+                       return mapping.findForward(SUCCESS);
+               }else {
+                       //deleteUser(request);
+                       String[] temp=path.split(",");
+                       String groupNmae=temp[0];
+                       if (temp.length==2) {
+                               String option = temp[1];
+                               request.setAttribute("option",option);
+                       }                       
+                       request.setAttribute("groupName",groupNmae);
+                       return mapping.findForward(FORWARD_GROUP);
+               }
+               //return mapping.findForward(SUCCESS);
+       }
+
+       private void deleteUser(HttpServletRequest request) {
                String authenticationId = 
request.getParameter(AUTHENTICATION_ID);
                if (StringUtils.isNotBlank(authenticationId)) {
                        Long authId = Long.valueOf(authenticationId);
             getPersonService().deletePersonByAuthenticationId(authId);
                        getAuthenticationService().deleteAuthentication(authId);
                }
-               return mapping.findForward(SUCCESS);
        }
 }


Index: SearchConditionalUserAction.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms/SearchConditionalUserAction.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- SearchConditionalUserAction.java    4 Aug 2008 07:12:07 -0000       1.12
+++ SearchConditionalUserAction.java    5 Aug 2008 05:44:37 -0000       1.13
@@ -62,10 +62,17 @@
                        ActionForm actionForm, HttpServletRequest request,
                        HttpServletResponse httpServletResponse) throws 
Exception {
                SearchForm searchform = (SearchForm) actionForm;
+               String option = searchform.getOption();
                Map<String, String> map = getParameterMap(actionForm);
                String groupName = request.getParameter("groupName");
+               if (null==groupName||"".equals(groupName)) {
+                       groupName = (String) request.getAttribute("groupName");
+               }
+               if (null==option||"".equals(option)) {
+                       option = (String) request.getAttribute("option");
+               }               
                String[] authIds = searchform.getChk_();
-               chooseOption(request, searchform, map, groupName, authIds);
+               chooseOption(request, option, map, groupName, authIds);
                List<Person> persons = personService.getAssociatedPersons(map);
                int totalCount = personService.getAssociatedPersonsNum(map);
                setSharedAttributes(request, persons, totalCount);
@@ -73,8 +80,8 @@
                return actionMapping.findForward("group");
        }
 
-private void chooseOption(HttpServletRequest request, SearchForm searchform, 
Map<String, String> map, String groupName, String[] authIds) {
-       String option = searchform.getOption();
+private void chooseOption(HttpServletRequest request, String option, 
Map<String, String> map, String groupName, String[] authIds) {
+       //String option = searchform.getOption();
        if (null != authIds&&"remove".equals(option)) {
                removeAuthorityFromUser(groupName, authIds);
        }
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to