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: [email protected]
For additional commands, e-mail: [email protected]