2823 |
31 Oct 06 |
nicklas |
1 |
<%-- $Id$ |
2823 |
31 Oct 06 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2006, 2007 Nicklas Nordborg |
2823 |
31 Oct 06 |
nicklas |
4 |
|
2823 |
31 Oct 06 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
2823 |
31 Oct 06 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
2823 |
31 Oct 06 |
nicklas |
7 |
|
2823 |
31 Oct 06 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
2823 |
31 Oct 06 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
10 |
as published by the Free Software Foundation; either version 3 |
2823 |
31 Oct 06 |
nicklas |
11 |
of the License, or (at your option) any later version. |
2823 |
31 Oct 06 |
nicklas |
12 |
|
2823 |
31 Oct 06 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
2823 |
31 Oct 06 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
2823 |
31 Oct 06 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2823 |
31 Oct 06 |
nicklas |
16 |
GNU General Public License for more details. |
2823 |
31 Oct 06 |
nicklas |
17 |
|
2823 |
31 Oct 06 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
2823 |
31 Oct 06 |
nicklas |
20 |
------------------------------------------------------------------ |
2823 |
31 Oct 06 |
nicklas |
21 |
|
2823 |
31 Oct 06 |
nicklas |
22 |
@author Nicklas |
2823 |
31 Oct 06 |
nicklas |
23 |
@version 2.0 |
2823 |
31 Oct 06 |
nicklas |
24 |
--%> |
5426 |
24 Sep 10 |
nicklas |
25 |
<%@ page pageEncoding="UTF-8" session="false" |
2823 |
31 Oct 06 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
2823 |
31 Oct 06 |
nicklas |
27 |
import="net.sf.basedb.core.DbControl" |
2823 |
31 Oct 06 |
nicklas |
28 |
import="net.sf.basedb.core.News" |
2823 |
31 Oct 06 |
nicklas |
29 |
import="net.sf.basedb.core.User" |
2823 |
31 Oct 06 |
nicklas |
30 |
import="net.sf.basedb.core.ItemQuery" |
2823 |
31 Oct 06 |
nicklas |
31 |
import="net.sf.basedb.core.ItemResultList" |
2823 |
31 Oct 06 |
nicklas |
32 |
import="net.sf.basedb.core.query.Orders" |
2823 |
31 Oct 06 |
nicklas |
33 |
import="net.sf.basedb.core.query.Hql" |
2823 |
31 Oct 06 |
nicklas |
34 |
import="net.sf.basedb.clients.web.Base" |
2823 |
31 Oct 06 |
nicklas |
35 |
import="net.sf.basedb.clients.web.util.HTML" |
2823 |
31 Oct 06 |
nicklas |
36 |
import="net.sf.basedb.util.Values" |
2823 |
31 Oct 06 |
nicklas |
37 |
%> |
2823 |
31 Oct 06 |
nicklas |
38 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
2823 |
31 Oct 06 |
nicklas |
39 |
<% |
2823 |
31 Oct 06 |
nicklas |
40 |
final String login = Values.getString(request.getParameter("login"), ""); |
2823 |
31 Oct 06 |
nicklas |
41 |
final String error = Values.getString(request.getParameter("error"), null); |
2823 |
31 Oct 06 |
nicklas |
42 |
final String root = request.getContextPath()+"/"; |
2823 |
31 Oct 06 |
nicklas |
43 |
|
2823 |
31 Oct 06 |
nicklas |
44 |
final SessionControl sc = Base.getSessionControl(pageContext, true); |
2823 |
31 Oct 06 |
nicklas |
45 |
final String ID = sc.getId(); |
7954 |
12 May 21 |
nicklas |
46 |
final DbControl dc = sc.newDbControl(":Impersonate user"); |
2823 |
31 Oct 06 |
nicklas |
47 |
ItemResultList<News> news = null; |
2823 |
31 Oct 06 |
nicklas |
48 |
try |
2823 |
31 Oct 06 |
nicklas |
49 |
{ |
2823 |
31 Oct 06 |
nicklas |
50 |
User currentUser = null; |
2823 |
31 Oct 06 |
nicklas |
51 |
int userId = Values.getInt(request.getParameter("user_id")); |
2823 |
31 Oct 06 |
nicklas |
52 |
if (userId != 0) currentUser = User.getById(dc, userId); |
2823 |
31 Oct 06 |
nicklas |
53 |
%> |
2823 |
31 Oct 06 |
nicklas |
54 |
<base:page type="popup" title="Impersonate user"> |
7538 |
28 Nov 18 |
nicklas |
55 |
<base:head scripts="~impersonate.js" styles="login.css" /> |
6151 |
27 Sep 12 |
nicklas |
56 |
<base:body> |
5907 |
13 Dec 11 |
nicklas |
57 |
<h1>Impersonate user <base:help helpid="impersonateuser" /></h1> |
6162 |
10 Oct 12 |
nicklas |
58 |
<form name="login" action="login.jsp" method="post"> |
2823 |
31 Oct 06 |
nicklas |
59 |
<input type="hidden" name="cmd" value="Impersonate"> |
2823 |
31 Oct 06 |
nicklas |
60 |
<input type="hidden" name="ID" value="<%=ID%>"> |
2823 |
31 Oct 06 |
nicklas |
61 |
<input type="hidden" name="again" value="1"> |
3504 |
15 Jun 07 |
nicklas |
62 |
<input type="hidden" name="redirect" value=""> |
7352 |
28 Apr 17 |
nicklas |
63 |
<input type="hidden" name="useAutoStartPage" value="0"> |
2823 |
31 Oct 06 |
nicklas |
64 |
|
5907 |
13 Dec 11 |
nicklas |
65 |
<div class="content"> |
5977 |
20 Feb 12 |
nicklas |
66 |
<table class="fullform input100 bottomborder"> |
2823 |
31 Oct 06 |
nicklas |
67 |
<% |
2823 |
31 Oct 06 |
nicklas |
68 |
if (error != null) |
2823 |
31 Oct 06 |
nicklas |
69 |
{ |
2823 |
31 Oct 06 |
nicklas |
70 |
%> |
5977 |
20 Feb 12 |
nicklas |
71 |
<tr> |
5977 |
20 Feb 12 |
nicklas |
72 |
<td colspan="3"> |
5977 |
20 Feb 12 |
nicklas |
73 |
<div class="messagecontainer error"><%=error%></div> |
5977 |
20 Feb 12 |
nicklas |
74 |
</td> |
5977 |
20 Feb 12 |
nicklas |
75 |
</tr> |
2823 |
31 Oct 06 |
nicklas |
76 |
<% |
2823 |
31 Oct 06 |
nicklas |
77 |
} |
2823 |
31 Oct 06 |
nicklas |
78 |
%> |
2823 |
31 Oct 06 |
nicklas |
79 |
<tr> |
5907 |
13 Dec 11 |
nicklas |
80 |
<th>User</th> |
5907 |
13 Dec 11 |
nicklas |
81 |
<td colspan="2"> |
2823 |
31 Oct 06 |
nicklas |
82 |
<base:select |
2823 |
31 Oct 06 |
nicklas |
83 |
id="user_id" |
2823 |
31 Oct 06 |
nicklas |
84 |
clazz="selectionlist" |
2823 |
31 Oct 06 |
nicklas |
85 |
required="true" |
2823 |
31 Oct 06 |
nicklas |
86 |
current="<%=currentUser%>" |
2823 |
31 Oct 06 |
nicklas |
87 |
recent="<%=null%>" |
2823 |
31 Oct 06 |
nicklas |
88 |
newitem="true" |
2823 |
31 Oct 06 |
nicklas |
89 |
/> |
5907 |
13 Dec 11 |
nicklas |
90 |
</td> |
2823 |
31 Oct 06 |
nicklas |
91 |
|
2823 |
31 Oct 06 |
nicklas |
92 |
</tr> |
3504 |
15 Jun 07 |
nicklas |
93 |
<tr> |
5907 |
13 Dec 11 |
nicklas |
94 |
<th><label for="remainOnPage">Remain on page</label></th> |
3504 |
15 Jun 07 |
nicklas |
95 |
<td> |
5812 |
17 Oct 11 |
nicklas |
96 |
<input type="checkbox" name="remainOnPage" id="remainOnPage" checked value="1"> |
3504 |
15 Jun 07 |
nicklas |
97 |
</td> |
5907 |
13 Dec 11 |
nicklas |
98 |
<td></td> |
3504 |
15 Jun 07 |
nicklas |
99 |
</tr> |
5907 |
13 Dec 11 |
nicklas |
100 |
<tr class="dynamic"> |
5907 |
13 Dec 11 |
nicklas |
101 |
<th>Comment</th> |
5907 |
13 Dec 11 |
nicklas |
102 |
<td> |
6167 |
12 Oct 12 |
nicklas |
103 |
<textarea class="text" rows="6" name="comment" id="comment"></textarea> |
5907 |
13 Dec 11 |
nicklas |
104 |
</td> |
5907 |
13 Dec 11 |
nicklas |
105 |
<td> |
6167 |
12 Oct 12 |
nicklas |
106 |
<base:zoom textarea="comment" title="Comment" /> |
2823 |
31 Oct 06 |
nicklas |
107 |
</td> |
2823 |
31 Oct 06 |
nicklas |
108 |
</tr> |
2823 |
31 Oct 06 |
nicklas |
109 |
</table> |
2823 |
31 Oct 06 |
nicklas |
110 |
</div> |
2823 |
31 Oct 06 |
nicklas |
111 |
</form> |
2823 |
31 Oct 06 |
nicklas |
112 |
|
5907 |
13 Dec 11 |
nicklas |
113 |
<base:buttongroup subclass="dialogbuttons"> |
6167 |
12 Oct 12 |
nicklas |
114 |
<base:button id="btnLogin" image="login.png" title="Impersonate" /> |
6167 |
12 Oct 12 |
nicklas |
115 |
<base:button id="close" title="Cancel" /> |
5907 |
13 Dec 11 |
nicklas |
116 |
</base:buttongroup> |
2823 |
31 Oct 06 |
nicklas |
117 |
|
2823 |
31 Oct 06 |
nicklas |
118 |
</base:body> |
2823 |
31 Oct 06 |
nicklas |
119 |
</base:page> |
2823 |
31 Oct 06 |
nicklas |
120 |
<% |
2823 |
31 Oct 06 |
nicklas |
121 |
} |
2823 |
31 Oct 06 |
nicklas |
122 |
finally |
2823 |
31 Oct 06 |
nicklas |
123 |
{ |
2823 |
31 Oct 06 |
nicklas |
124 |
if (dc != null) dc.close(); |
2823 |
31 Oct 06 |
nicklas |
125 |
} |
2823 |
31 Oct 06 |
nicklas |
126 |
%> |
2823 |
31 Oct 06 |
nicklas |
127 |
|