Changeset 337

Show
Ignore:
Timestamp:
04/06/06 11:55:33
Author:
douglm
Message:

Clean up and close on logout

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/REL-3.0/calendar3/common/src/edu/rpi/sss/util/jsp/UtilAbstractAction.java

    r293 r337  
    313313         ---------------------------------------------------------------- */ 
    314314 
    315       forward = checkLogOut(request); 
     315      forward = checkLogOut(request, form); 
    316316      if (forward != null) { 
    317317        // Disable xslt filters 
     
    656656   * ==================================================================== */ 
    657657 
     658  /** Clean up - we're about to logout 
     659   * 
     660   * @param request    HttpServletRequest 
     661   * @return boolean true for OK to log out. False - not allowed - ignore it. 
     662   */ 
     663  protected boolean logOutCleanup(HttpServletRequest request, 
     664                                  UtilActionForm form) { 
     665    return true; 
     666  } 
     667 
    658668  /** Check for logout request. 
    659669   * 
     
    661671   * @return null for continue, forwardLoggedOut to end session. 
    662672   */ 
    663   protected String checkLogOut(HttpServletRequest request) 
     673  protected String checkLogOut(HttpServletRequest request, 
     674                               UtilActionForm form) 
    664675               throws Throwable { 
    665676    String temp = request.getParameter(requestLogout); 
     
    667678      HttpSession sess = request.getSession(false); 
    668679 
    669       if (sess != null) { 
     680      if ((sess != null) && logOutCleanup(request, form)) { 
    670681        sess.invalidate(); 
    671682      } 
  • branches/REL-3.0/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java

    r330 r337  
    837837  } 
    838838 
     839  /* We should probably return false for a portlet 
     840   *  (non-Javadoc) 
     841   * @see edu.rpi.sss.util.jsp.UtilAbstractAction#logOutCleanup(javax.servlet.http.HttpServletRequest) 
     842   */ 
     843  protected boolean logOutCleanup(HttpServletRequest request, 
     844                                  UtilActionForm form) { 
     845    HttpSession hsess = request.getSession(); 
     846    BwCallback cb = (BwCallback)hsess.getAttribute(BwCallback.cbAttrName); 
     847     
     848    if (cb == null) { 
     849      if (form.getDebug()) { 
     850        debugMsg("No cb object for logout"); 
     851      } 
     852    } else { 
     853      if (form.getDebug()) { 
     854        debugMsg("cb object found for logout"); 
     855      } 
     856      try { 
     857        cb.out(); 
     858      } catch (Throwable t) {} 
     859       
     860      try { 
     861        cb.close(); 
     862      } catch (Throwable t) {} 
     863    } 
     864     
     865    return true; 
     866  } 
     867 
     868 
    839869  /** Ensure we have a CalAdminSvcI object for the given user. 
    840870   *