portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r761630 - in /portals/jetspeed-2/portal: branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/ trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/
Date Fri, 03 Apr 2009 11:54:28 GMT
Author: vkumar
Date: Fri Apr  3 11:54:28 2009
New Revision: 761630

URL: http://svn.apache.org/viewvc?rev=761630&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.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java?rev=761630&r1=761629&r2=761630&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
Fri Apr  3 11:54:28 2009
@@ -129,16 +129,15 @@
                     log.error("Unknown user Principal "+userPrincipal.getName()+": creating
a default subject without any roles", sex);
                     subject = JetspeedSubjectFactory.createSubject(userMgr.newTransientUser(userPrincipal.getName()),
null, null, null);
                 }
-            }       
-            
-            // 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;
     }
             

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java?rev=761630&r1=761629&r2=761630&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java
Fri Apr  3 11:54:28 2009
@@ -130,15 +130,14 @@
                     subject = JetspeedSubjectFactory.createSubject(userMgr.newTransientUser(userPrincipal.getName()),
null, null, null);
                 }
             }       
-            
-            // 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


Mime
View raw message