portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20246] New: - [FIX] AccessController can set null profile in particular case
Date Mon, 26 May 2003 16:41:20 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20246>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20246

[FIX] AccessController can set null profile in particular case

           Summary: [FIX] AccessController can set null profile in
                    particular case
           Product: Jetspeed
           Version: 1.4b5-dev / CVS
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Login
        AssignedTo: jetspeed-dev@jakarta.apache.org
        ReportedBy: apernoud@sopragroup.com


I don't know if this can be fixed in cvs, but here's the point : my table 
turbine_user is already filled by another app, but I don't create any psml for 
it. So at login, I test if the user has a psml, if not, then I create one for 
it.
It works fine except that when I set the current profile in jdata, there's 
another class (JetspeedAccessController) that changes it back to 'null', and 
then it breaks :(
Here is the patch for it, it's only an addition to a test to see if we're 
trying to replace an existing psml non null with a null one...
the relevant code is only here :
-         || (!currentProfile.equals(newProfile)))
+         || ((!currentProfile.equals(newProfile) && newProfile != null)))
         {
             // the profile changed due to the request parameters,
             // change it in the RunData
             jdata.setProfile(newProfile);
         }
In my case, currentProfile is not null, but newProfile is null (I don't get it 
yet, I think it's because of cache ?), and so my newly created profile is 
ripped out.
Hope I was clear enough.
Aurelien

Index: JetspeedAccessController.java
===================================================================
RCS file: /home/cvspublic/jakarta-
jetspeed/src/java/org/apache/jetspeed/modules/actions/JetspeedAccessController.j
ava,v
retrieving revision 1.7
diff -u -r1.7 JetspeedAccessController.java
--- JetspeedAccessController.java	7 May 2003 15:16:47 -0000	1.7
+++ JetspeedAccessController.java	26 May 2003 16:31:33 -0000
@@ -51,7 +51,7 @@
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
  */
- 
+
 package org.apache.jetspeed.modules.actions;
 
 import org.apache.turbine.util.RunData;
@@ -67,7 +67,7 @@
     Calls the profiler to load the requested PSML resource based on request 
params
     Its necessary to load the profile from this action, not the 
SessionValidator
     in order to get the cached ACL list from logon
-  
+
 @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
 @version $Id: JetspeedAccessController.java,v 1.7 2003/05/07 15:16:47 morciuch 
Exp $
 */
@@ -80,7 +80,7 @@
 
         getACL(data);
         JetspeedRunData jdata = null;
-        
+
         try
         {
             jdata = (JetspeedRunData)data;
@@ -100,19 +100,19 @@
 
 
         if ((currentProfile == null)
-         || (!currentProfile.equals(newProfile)))
+         || ((!currentProfile.equals(newProfile) && newProfile != null)))
         {
             // the profile changed due to the request parameters,
             // change it in the RunData
             jdata.setProfile(newProfile);
         }
- 
+
     }
 
     protected void getACL(RunData data)
     {
         data.setACL(null);
-/*    
+/*
         if ( data.getUser() != null && data.getUser().hasLoggedIn() )
         {
             AccessControlList acl = (AccessControlList)

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


Mime
View raw message