geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r474430 - /geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/SEUsersPortlet.java
Date Mon, 13 Nov 2006 18:45:34 GMT
Author: vamsic007
Date: Mon Nov 13 10:45:34 2006
New Revision: 474430

URL: http://svn.apache.org/viewvc?view=rev&rev=474430
Log:
GERONIMO-1641 Using default Console Realm, when delete a user it will not be removed from
the groups

Modified:
    geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/SEUsersPortlet.java

Modified: geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/SEUsersPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/SEUsersPortlet.java?view=diff&rev=474430&r1=474429&r2=474430
==============================================================================
--- geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/SEUsersPortlet.java
(original)
+++ geronimo/server/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/SEUsersPortlet.java
Mon Nov 13 10:45:34 2006
@@ -18,6 +18,7 @@
 package org.apache.geronimo.console.securitymanager;
 
 import java.io.IOException;
+import java.util.Collection;
 import java.util.Hashtable;
 
 import javax.portlet.ActionRequest;
@@ -29,6 +30,7 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
+import org.apache.geronimo.console.util.SERealmGroupHelper;
 import org.apache.geronimo.console.util.SERealmUserHelper;
 
 public class SEUsersPortlet extends AbstractSecurityManagerPortlet {
@@ -116,6 +118,16 @@
         try {
             if ("delete".equals(action)) {
                 SERealmUserHelper.deleteUser(user);
+                String[] groups = SERealmGroupHelper.getGroups();
+                for (int i = 0; i < groups.length; i++) {
+                    String currentGroup = groups[i];
+                    if (SERealmGroupHelper.isGroupMember(currentGroup, user)) {
+                        Collection list = SERealmGroupHelper.getUsers(currentGroup);
+                        list.remove(user);
+                        String[] groupUsers = (String[]) list.toArray(new String[0]);
+                        SERealmGroupHelper.updateGroup(currentGroup, groupUsers);
+                    }
+                }
             } else if ("update".equals(action)) {
                 SERealmUserHelper.updateUser(user, password);
             } else if ("add".equals(action)) {



Mime
View raw message