You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by vk...@apache.org on 2009/04/03 14:03:11 UTC

svn commit: r761639 - /portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java

Author: vkumar
Date: Fri Apr  3 12:03:11 2009
New Revision: 761639

URL: http://svn.apache.org/viewvc?rev=761639&view=rev
Log:
JS2-951
Adding request IP in session for statistics, even if user has pre-populated subject

Modified:
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java?rev=761639&r1=761638&r2=761639&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java Fri Apr  3 12:03:11 2009
@@ -122,16 +122,16 @@
                 Set principals = new HashSet();
                 principals.add(userPrincipal);
                 subject = new Subject(true, principals, new HashSet(), new HashSet());
-            } 
-            
-            // create a new statistics *user* session
-            if (statistics != null)
-            {
+            }                       
+        }
+        
+        if(statistics!=null && request.getSessionAttribute(IP_ADDRESS)==null)
+        {
+                //create a new statistics *user* session
                 statistics.logUserLogin(request, 0);
-            }
-            // put IP address in session for logout
-            request.setSessionAttribute(IP_ADDRESS, request.getRequest().getRemoteAddr());            
-        }               
+                request.setSessionAttribute(IP_ADDRESS, request.getRequest().getRemoteAddr());
+                // put IP address in session for logout
+        }        
         return subject;
     }
             



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