portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1656145 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security: ChangePasswordPortlet.java JetspeedPrincipalManagementPortlet.java
Date Sat, 31 Jan 2015 03:09:34 GMT
Author: taylor
Date: Sat Jan 31 03:09:34 2015
New Revision: 1656145

URL: http://svn.apache.org/r1656145
Log:
PB-112: sync with latest audit changes

Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java?rev=1656145&r1=1656144&r2=1656145&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java
Sat Jan 31 03:09:34 2015
@@ -16,21 +16,6 @@
  */
 package org.apache.jetspeed.portlets.security;
 
-import java.io.IOException;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.ResourceBundle;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.security.auth.Subject;
-
 import org.apache.jetspeed.CommonPortletServices;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.audit.AuditActivity;
@@ -45,6 +30,20 @@ import org.apache.jetspeed.security.User
 import org.apache.jetspeed.security.UserManager;
 import org.apache.portals.bridges.common.GenericServletPortlet;
 
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.security.auth.Subject;
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.ResourceBundle;
+
 /**
  * This portlet allows a logged on user to change its password.
  *
@@ -178,7 +177,7 @@ public class ChangePasswordPortlet exten
                     	PasswordCredential credential = manager.getPasswordCredential(user);
                     	credential.setPassword(currPassword, newPassword);
                     	manager.storePasswordCredential(credential);
-                        audit.logUserActivity(userName, getIPAddress(actionRequest), AuditActivity.PASSWORD_CHANGE_SUCCESS,
USER_ADMINISTRATION);
+                        audit.logUserActivity(userName, getIPAddress(actionRequest), AuditActivity.PASSWORD_RESET,
USER_ADMINISTRATION);
 
                         // update Subject in session to reflect the changed PasswordCredential
                         RequestContext requestContext = (RequestContext)actionRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
                 

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java?rev=1656145&r1=1656144&r2=1656145&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/JetspeedPrincipalManagementPortlet.java
Sat Jan 31 03:09:34 2015
@@ -797,6 +797,15 @@ public class JetspeedPrincipalManagement
                         userManager.storePasswordCredential(credential);
                         setPrincipal(user);
                         controlPannels(true);
+                        getServiceLocator()
+                                .getAuditActivity().logAdminUserActivity(
+                                getPortletRequest()
+                                        .getUserPrincipal()
+                                        .getName(),
+                                getIPAddress(),
+                                getPrincipal().getName(),
+                                AuditActivity.USER_CREATE,
+                                AdminPortletWebPage.USER_ADMINISTRATION);
                     }
                     catch (SecurityException jSx)
                     {
@@ -949,6 +958,18 @@ public class JetspeedPrincipalManagement
                     try
                     {
                         getManager().removePrincipal(principal.getName());
+                        if (principal instanceof User) {
+                            getServiceLocator()
+                                    .getAuditActivity().logAdminUserActivity(
+                                    getPortletRequest()
+                                            .getUserPrincipal()
+                                            .getName(),
+                                    getIPAddress(),
+                                    getPrincipal().getName(),
+                                    AuditActivity.USER_DELETE,
+                                    AdminPortletWebPage.USER_ADMINISTRATION);
+                        }
+                        // TODO: role, group
                         setPrincipal(null);
                         controlPannels(false);
                         principalDataProvider.refresh(getManager(),getSearchString());



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message