[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security ...

Shane Bryzak sbryzak at redhat.com
Tue Nov 13 21:26:44 EST 2007


  User: sbryzak2
  Date: 07/11/13 21:26:44

  Modified:    src/main/org/jboss/seam/security   FacesSecurityEvents.java
                        Identity.java
  Log:
  fixed infinite loop
  
  Revision  Changes    Path
  1.3       +9 -9      jboss-seam/src/main/org/jboss/seam/security/FacesSecurityEvents.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FacesSecurityEvents.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/FacesSecurityEvents.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- FacesSecurityEvents.java	7 Nov 2007 08:47:28 -0000	1.2
  +++ FacesSecurityEvents.java	14 Nov 2007 02:26:44 -0000	1.3
  @@ -37,7 +37,7 @@
      }   
      
      @Observer(Identity.EVENT_INIT_IDENTITY)
  -   public void initCredentialsFromCookie()
  +   public void initCredentialsFromCookie(Identity identity)
      {       
         FacesContext ctx = FacesContext.getCurrentInstance();
         if (ctx != null)
  @@ -45,14 +45,14 @@
            setCookiePath(ctx.getExternalContext().getRequestContextPath());
         }
         
  -      Identity.instance().setRememberMe(isCookieEnabled());      
  +      identity.setRememberMe(isCookieEnabled());      
         
         String username = getCookieValue();
         if (username!=null)
         {
            setCookieEnabled(true);
  -         Identity.instance().setUsername(username);
  -         postRememberMe();
  +         identity.setUsername(username);
  +         postRememberMe(identity);
         }
               
         setDirty();
  @@ -65,19 +65,19 @@
      }
      
      @Observer(Identity.EVENT_POST_AUTHENTICATE)
  -   public void postAuthenticate()
  +   public void postAuthenticate(Identity identity)
      {
         // Password is set to null during authentication, so we set dirty
         setDirty();
               
  -      if ( !Identity.instance().isRememberMe() ) clearCookieValue();
  -      setCookieValueIfEnabled( Identity.instance().getUsername() );      
  +      if ( !identity.isRememberMe() ) clearCookieValue();
  +      setCookieValueIfEnabled( identity.getUsername() );      
      }
      
      @Observer(Identity.EVENT_REMEMBER_ME)
  -   public void postRememberMe()
  +   public void postRememberMe(Identity identity)
      {
  -      setCookieEnabled(Identity.instance().isRememberMe());
  +      setCookieEnabled(identity.isRememberMe());
      }     
      
      @Observer(Identity.EVENT_LOGIN_FAILED)
  
  
  
  1.106     +3 -3      jboss-seam/src/main/org/jboss/seam/security/Identity.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Identity.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/Identity.java,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -b -r1.105 -r1.106
  --- Identity.java	12 Nov 2007 10:59:14 -0000	1.105
  +++ Identity.java	14 Nov 2007 02:26:44 -0000	1.106
  @@ -104,7 +104,7 @@
      public void create()
      {     
         subject = new Subject();
  -      Events.instance().raiseEvent(EVENT_INIT_IDENTITY);
  +      Events.instance().raiseEvent(EVENT_INIT_IDENTITY, this);
      }
      
      public static boolean isSecurityEnabled()
  @@ -307,7 +307,7 @@
         
         password = null;
   
  -      Events.instance().raiseEvent(EVENT_POST_AUTHENTICATE);
  +      Events.instance().raiseEvent(EVENT_POST_AUTHENTICATE, this);
      }
      
      /**
  @@ -586,7 +586,7 @@
         if (this.rememberMe != remember)
         {
            this.rememberMe = remember;
  -         Events.instance().raiseEvent(EVENT_REMEMBER_ME);
  +         Events.instance().raiseEvent(EVENT_REMEMBER_ME, this);
         }
      }
      
  
  
  



More information about the jboss-cvs-commits mailing list