You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2003/05/23 14:35:33 UTC

cvs commit: cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/acting LogoutAction.java

cziegeler    2003/05/23 05:35:33

  Modified:    src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context
                        AuthenticationContext.java
                        AuthenticationContextProvider.java
               src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components
                        DefaultAuthenticationManager.java
               src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/acting
                        LogoutAction.java
  Log:
  Blast away wrong usage of getting the object model
  
  Revision  Changes    Path
  1.8       +3 -2      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java
  
  Index: AuthenticationContext.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AuthenticationContext.java	23 May 2003 12:13:14 -0000	1.7
  +++ AuthenticationContext.java	23 May 2003 12:35:32 -0000	1.8
  @@ -92,7 +92,8 @@
       private String          handlerName;
       private boolean        initialized;
       
  -    ThreadLocal     state = new InheritableThreadLocal();
  +    // FIXME
  +    public static ThreadLocal     state = new InheritableThreadLocal();
       
       public AuthenticationContext(UserHandler handler) {
           this.name = AuthenticationConstants.SESSION_CONTEXT_NAME;
  
  
  
  1.5       +1 -2      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContextProvider.java
  
  Index: AuthenticationContextProvider.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContextProvider.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AuthenticationContextProvider.java	23 May 2003 12:13:14 -0000	1.4
  +++ AuthenticationContextProvider.java	23 May 2003 12:35:32 -0000	1.5
  @@ -101,7 +101,6 @@
                   UserHandler handler = state.getHandler();
                   if ( handler != null ) {
                       context = handler.getContext();
  -                    context.state.set( state );
                   }
               }
           }
  
  
  
  1.11      +3 -1      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
  
  Index: DefaultAuthenticationManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultAuthenticationManager.java	23 May 2003 12:13:14 -0000	1.10
  +++ DefaultAuthenticationManager.java	23 May 2003 12:35:32 -0000	1.11
  @@ -74,6 +74,7 @@
   import org.apache.cocoon.webapps.authentication.AuthenticationConstants;
   import org.apache.cocoon.webapps.authentication.AuthenticationManager;
   import org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration;
  +import org.apache.cocoon.webapps.authentication.context.AuthenticationContext;
   import org.apache.cocoon.webapps.authentication.user.RequestState;
   import org.apache.cocoon.webapps.authentication.user.UserHandler;
   import org.apache.cocoon.webapps.authentication.user.UserState;
  @@ -386,6 +387,7 @@
       }
   
       protected void setState(RequestState status) {
  +        AuthenticationContext.state.set(status);
           final Request req = ContextHelper.getRequest(this.context);
           if ( status != null ) {
               req.setAttribute(  REQUEST_STATE_KEY, status);
  
  
  
  1.4       +2 -2      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/acting/LogoutAction.java
  
  Index: LogoutAction.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/acting/LogoutAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LogoutAction.java	23 May 2003 12:13:13 -0000	1.3
  +++ LogoutAction.java	23 May 2003 12:35:33 -0000	1.4
  @@ -101,9 +101,9 @@
           // logout
           AuthenticationManager authManager = null;
           try {
  +            authManager = (AuthenticationManager) this.manager.lookup(AuthenticationManager.ROLE);
               RequestState state = authManager.getState();
               
  -            authManager = (AuthenticationManager) this.manager.lookup(AuthenticationManager.ROLE);
               final String handlerName = par.getParameter("handler",
                                                            (state == null ? null : state.getHandlerName()));
               if ( null == handlerName )