Changeset 6531


Ignore:
Timestamp:
Sep 19, 2014, 12:42:19 PM (8 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1844: Logout dialog still warn about not being logged in in some cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-stable/www/logout.jsp

    r6505 r6531  
    4040<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    4141<%
    42 final SessionControl sc = Base.getExistingSessionControl(pageContext, false);
    43 final String ID = sc.getId();
    44 final boolean noconfirm = Values.getBoolean(request.getParameter("noconfirm"), !sc.isLoggedIn());
     42final SessionControl sc = Base.getSessionControl(pageContext, false);
     43final boolean noconfirm = sc == null || !sc.isLoggedIn() ||
     44    Values.getBoolean(request.getParameter("noconfirm"));
     45final String ID = sc == null ? "" : sc.getId();
    4546if (noconfirm)
    4647{
    4748  // Redirect to main login page
    4849  String redirect = "common/close_popup.jsp?ID="+ID+"&wait=0&redirect_opener=../main.jsp?ID="+ID;;
    49   if (sc.isImpersonated())
     50  if (sc != null)
    5051  {
    51     SessionControl original = (SessionControl)sc.getSessionSetting("impersonate.originalSessionControl");
    52     boolean revert = Values.getBoolean(request.getParameter("revert"));
    53     if (revert)
     52    if (sc.isImpersonated())
    5453    {
    55       redirect = "common/close_popup.jsp?ID="+original.getId()+"&wait=0&redirect_opener=../my_base/index.jsp?ID="+original.getId();
     54      SessionControl original = (SessionControl)sc.getSessionSetting("impersonate.originalSessionControl");
     55      boolean revert = Values.getBoolean(request.getParameter("revert"));
     56      if (revert)
     57      {
     58        redirect = "common/close_popup.jsp?ID="+original.getId()+"&wait=0&redirect_opener=../my_base/index.jsp?ID="+original.getId();
     59      }
     60      else
     61      {
     62        original.logout();
     63      }
    5664    }
    57     else
    58     {
    59       original.logout();
    60     }
     65    sc.logout();
    6166  }
    62   sc.logout();
    6367  response.sendRedirect(redirect);
    6468  return;
    6569}
    66 String title = sc.isImpersonated() ? "Logout impersonated?" : "Logout?";
     70String title = sc != null && sc.isImpersonated() ? "Logout impersonated?" : "Logout?";
    6771%>
    6872<base:page type="popup" title="<%=title%>">
Note: See TracChangeset for help on using the changeset viewer.