cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/acting LoggedInAction.java
Date Fri, 12 Dec 2003 11:14:11 GMT
cziegeler    2003/12/12 03:14:11

  Modified:    src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/acting
                        LoggedInAction.java
  Log:
  Test for not logged in as well
  
  Revision  Changes    Path
  1.5       +11 -3     cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/acting/LoggedInAction.java
  
  Index: LoggedInAction.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/acting/LoggedInAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LoggedInAction.java	21 Oct 2003 11:52:36 -0000	1.4
  +++ LoggedInAction.java	12 Dec 2003 11:14:11 -0000	1.5
  @@ -87,11 +87,19 @@
           String handlerName = par.getParameter("handler", null);
           AuthenticationManager authManager = null;
   
  +        final boolean testNotLoggedIn = par.getParameterAsBoolean("negate-result", false);

  +        
           try {
               authManager = (AuthenticationManager) this.manager.lookup(AuthenticationManager.ROLE);
               UserHandler handler = authManager.isAuthenticated(handlerName);
  -            if ( handler != null ) {
  -                map = EMPTY_MAP;
  +            if ( testNotLoggedIn ) {
  +                if ( handler == null ) {
  +                    map = EMPTY_MAP;
  +                }
  +            } else {
  +                if ( handler != null ) {
  +                    map = EMPTY_MAP;
  +                }
               }
           } finally {
               this.manager.release( authManager);
  
  
  

Mime
View raw message