source: trunk/www/logout.jsp @ 5902

Last change on this file since 5902 was 5902, checked in by Nicklas Nordborg, 10 years ago

References #1655: GUI improvements

  • Make sure content on dialog can be placed so that it fills the free space between the title and buttons.


  • The 'Logout' dialog is easy and provides the simple case where everything is centered in the remaining space. Should also work when resizing the dialog.


  • The 'Reset filters' and 'Broadcast message' dialogs need a bit more work. The look ok now, but there are some minor things to fix yet.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.6 KB
Line 
1<%-- $Id: logout.jsp 5902 2011-12-08 14:01:38Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2005 Nicklas Nordborg
4  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg
5
6  This file is part of BASE - BioArray Software Environment.
7  Available at http://base.thep.lu.se/
8
9  BASE is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 3
12  of the License, or (at your option) any later version.
13
14  BASE is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  GNU General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
21  ------------------------------------------------------------------
22
23  Logout from BASE.
24
25  @param noconfirm
26    If specified on the URL we display a confirmation dialogue
27    otherwise we just log out and forward to the /main.jsp page
28
29  @author Nicklas
30  @version 2.0
31--%>
32<%@ page pageEncoding="UTF-8" session="false"
33  import="net.sf.basedb.core.SessionControl"
34  import="net.sf.basedb.core.User"
35  import="net.sf.basedb.util.Values"
36  import="net.sf.basedb.clients.web.Base"
37  import="net.sf.basedb.clients.web.WebException"
38  import="net.sf.basedb.clients.web.util.HTML"
39%>
40<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
41<%
42final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
43final String ID = sc.getId();
44final String noconfirm = request.getParameter("noconfirm");
45if (noconfirm != null)
46{
47  // Redirect to main login page
48  String redirect = "common/close_popup.jsp?ID="+ID+"&wait=0&redirect_opener=../main.jsp?ID="+ID;;
49  if (sc.isImpersonated())
50  {
51    SessionControl original = (SessionControl)sc.getSessionSetting("impersonate.originalSessionControl");
52    boolean revert = Values.getBoolean(request.getParameter("revert"));
53    if (revert)
54    {
55      redirect = "common/close_popup.jsp?ID="+original.getId()+"&wait=0&redirect_opener=../my_base/index.jsp?ID="+original.getId();
56    }
57    else
58    {
59      original.logout();
60    }
61  }
62  sc.logout();
63  response.sendRedirect(redirect);
64  return;
65}
66String title = sc.isImpersonated() ? "Logout impersonated?" : "Logout?";
67%>
68<base:page type="popup" title="<%=title%>">
69<base:head >
70  <script language="JavaScript">
71  function beginLogout()
72  {
73    Main.hide('confirm');
74    Main.hide('dialogbuttons');
75    Main.show('logout');
76    setTimeout("document.forms['logout'].submit()", 800);
77  }
78  </script>
79</base:head>
80<base:body>
81  <h1><%=title%></h1>
82  <div class="content">
83  <table class="fullcc"><tr><td>
84    <form action="logout.jsp" method="post" name="logout" onsubmit="return false;">
85    <input type="hidden" name="ID" value="<%=ID%>">
86    <input type="hidden" name="noconfirm" value="1">
87      <div id="confirm">
88        <b>Are you sure you want to logout? </b>
89        <br>
90        All unsaved data will be lost!
91        <% 
92        if (sc.isImpersonated())
93        {
94          User originalUser = (User)sc.getSessionSetting("impersonate.originalUser");
95          if (originalUser != null)
96          {
97            %>
98            <p>
99            <input type="checkbox" name="revert" id="revert" value="1" checked><label for="revert">Revert to
100            <%=HTML.encodeTags(originalUser.getName())%></label>
101            <%
102          }
103        }
104        %>
105      </div>
106      <div id="logout" style="display: none;">
107        <b>Logging out...</b>
108      </div>
109    </form>
110  </td></tr></table>
111  </div>
112  <base:buttongroup subclass="dialogbuttons" id="dialogbuttons">
113    <base:button onclick="beginLogout()" title="Yes" />
114    <base:button onclick="window.close()" title="No" />
115  </base:buttongroup>
116</base:body>
117</base:page>
Note: See TracBrowser for help on using the repository browser.