228 |
23 Mar 05 |
nicklas |
1 |
<%-- $Id$ |
228 |
23 Mar 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Johan Enell, Nicklas Nordborg, Martin Svensson |
228 |
23 Mar 05 |
nicklas |
6 |
|
2304 |
22 May 06 |
jari |
7 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
8 |
Available at http://base.thep.lu.se/ |
228 |
23 Mar 05 |
nicklas |
9 |
|
228 |
23 Mar 05 |
nicklas |
10 |
BASE is free software; you can redistribute it and/or |
228 |
23 Mar 05 |
nicklas |
11 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
12 |
as published by the Free Software Foundation; either version 3 |
228 |
23 Mar 05 |
nicklas |
13 |
of the License, or (at your option) any later version. |
228 |
23 Mar 05 |
nicklas |
14 |
|
228 |
23 Mar 05 |
nicklas |
15 |
BASE is distributed in the hope that it will be useful, |
228 |
23 Mar 05 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
228 |
23 Mar 05 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
228 |
23 Mar 05 |
nicklas |
18 |
GNU General Public License for more details. |
228 |
23 Mar 05 |
nicklas |
19 |
|
228 |
23 Mar 05 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
228 |
23 Mar 05 |
nicklas |
22 |
------------------------------------------------------------------ |
228 |
23 Mar 05 |
nicklas |
23 |
|
228 |
23 Mar 05 |
nicklas |
24 |
This page will save user information and preferences. |
228 |
23 Mar 05 |
nicklas |
25 |
|
228 |
23 Mar 05 |
nicklas |
26 |
@param cmd The command to execute |
228 |
23 Mar 05 |
nicklas |
27 |
- SaveSettings: Save the settings from the settings.jsp page. |
419 |
19 Apr 05 |
nicklas |
28 |
- SavePreferences: Save preferences from the preferences.jsp page. |
228 |
23 Mar 05 |
nicklas |
29 |
|
228 |
23 Mar 05 |
nicklas |
30 |
@author Nicklas |
228 |
23 Mar 05 |
nicklas |
31 |
@version 2.0 |
228 |
23 Mar 05 |
nicklas |
32 |
--%> |
5426 |
24 Sep 10 |
nicklas |
33 |
<%@ page pageEncoding="UTF-8" session="false" |
419 |
19 Apr 05 |
nicklas |
34 |
import="net.sf.basedb.core.SessionControl" |
419 |
19 Apr 05 |
nicklas |
35 |
import="net.sf.basedb.core.DbControl" |
2733 |
16 Oct 06 |
nicklas |
36 |
import="net.sf.basedb.core.Item" |
419 |
19 Apr 05 |
nicklas |
37 |
import="net.sf.basedb.core.User" |
2733 |
16 Oct 06 |
nicklas |
38 |
import="net.sf.basedb.core.ItemContext" |
5443 |
07 Oct 10 |
nicklas |
39 |
import="net.sf.basedb.core.ExtendedProperty" |
5443 |
07 Oct 10 |
nicklas |
40 |
import="net.sf.basedb.core.ExtendedProperties" |
5442 |
07 Oct 10 |
nicklas |
41 |
import="net.sf.basedb.util.EmailUtil" |
419 |
19 Apr 05 |
nicklas |
42 |
import="net.sf.basedb.clients.web.Base" |
419 |
19 Apr 05 |
nicklas |
43 |
import="net.sf.basedb.clients.web.WebException" |
228 |
23 Mar 05 |
nicklas |
44 |
import="net.sf.basedb.clients.web.util.HTML" |
5443 |
07 Oct 10 |
nicklas |
45 |
import="net.sf.basedb.util.Values" |
5443 |
07 Oct 10 |
nicklas |
46 |
import="net.sf.basedb.util.formatter.Formatter" |
7499 |
06 Aug 18 |
nicklas |
47 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
2942 |
22 Nov 06 |
nicklas |
48 |
import="net.sf.basedb.clients.web.formatter.FormatterSettings" |
5443 |
07 Oct 10 |
nicklas |
49 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
7604 |
25 Feb 19 |
nicklas |
50 |
import="net.sf.basedb.clients.web.extensions.edit.OnSaveAction" |
7499 |
06 Aug 18 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.edit.OnSaveRenderer" |
7499 |
06 Aug 18 |
nicklas |
52 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7499 |
06 Aug 18 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
7499 |
06 Aug 18 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
2907 |
14 Nov 06 |
nicklas |
55 |
import="java.util.Arrays" |
7295 |
20 Feb 17 |
nicklas |
56 |
import="java.util.Collections" |
5443 |
07 Oct 10 |
nicklas |
57 |
import="java.util.List" |
7496 |
11 Jul 18 |
nicklas |
58 |
import="java.util.Map" |
228 |
23 Mar 05 |
nicklas |
59 |
%> |
228 |
23 Mar 05 |
nicklas |
60 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
228 |
23 Mar 05 |
nicklas |
61 |
<% |
373 |
07 Apr 05 |
nicklas |
62 |
SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
228 |
23 Mar 05 |
nicklas |
63 |
String ID = sc.getId(); |
228 |
23 Mar 05 |
nicklas |
64 |
String cmd = request.getParameter("cmd"); |
228 |
23 Mar 05 |
nicklas |
65 |
String message = ""; |
228 |
23 Mar 05 |
nicklas |
66 |
String root = request.getContextPath()+"/"; |
228 |
23 Mar 05 |
nicklas |
67 |
|
7410 |
09 Oct 17 |
nicklas |
68 |
String forward = null; |
7954 |
12 May 21 |
nicklas |
69 |
DbControl dc = sc.newDbControl(":User settings - "+cmd); |
228 |
23 Mar 05 |
nicklas |
70 |
try |
228 |
23 Mar 05 |
nicklas |
71 |
{ |
419 |
19 Apr 05 |
nicklas |
72 |
if ("SaveSettings".equals(cmd)) |
228 |
23 Mar 05 |
nicklas |
73 |
{ |
228 |
23 Mar 05 |
nicklas |
74 |
String email = Values.getStringOrNull(request.getParameter("email")); |
228 |
23 Mar 05 |
nicklas |
75 |
if (email != null && !HTML.isValidEmail(email)) |
228 |
23 Mar 05 |
nicklas |
76 |
{ |
228 |
23 Mar 05 |
nicklas |
77 |
throw new WebException("popup", "Invalid email address", |
228 |
23 Mar 05 |
nicklas |
78 |
"The email address {1} is not a valid email address.", |
228 |
23 Mar 05 |
nicklas |
79 |
HTML.encodeTags(email) |
228 |
23 Mar 05 |
nicklas |
80 |
); |
228 |
23 Mar 05 |
nicklas |
81 |
} |
7605 |
26 Feb 19 |
nicklas |
82 |
User user = sc.getSessionSetting("user"); |
5060 |
19 Aug 09 |
nicklas |
83 |
dc.reattachItem(user, false); |
228 |
23 Mar 05 |
nicklas |
84 |
|
7499 |
06 Aug 18 |
nicklas |
85 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, null, user); |
7605 |
26 Feb 19 |
nicklas |
86 |
ExtensionsInvoker<OnSaveAction> invoker = ExtensionsControl.useExtensions(jspContext, EditUtil.EP_PREFIX_SAVE+"user-information"); |
7499 |
06 Aug 18 |
nicklas |
87 |
try |
5442 |
07 Oct 10 |
nicklas |
88 |
{ |
7499 |
06 Aug 18 |
nicklas |
89 |
// Contact information tab |
7499 |
06 Aug 18 |
nicklas |
90 |
user.setEmail(email); |
7499 |
06 Aug 18 |
nicklas |
91 |
boolean useDeviceVerification = Values.getBoolean(request.getParameter("useDeviceVerification")); |
7499 |
06 Aug 18 |
nicklas |
92 |
if (!useDeviceVerification) user.disableDeviceVerification(); |
7499 |
06 Aug 18 |
nicklas |
93 |
if (EmailUtil.isEnabled()) |
7410 |
09 Oct 17 |
nicklas |
94 |
{ |
7499 |
06 Aug 18 |
nicklas |
95 |
user.setSendMessagesAsEmail(email != null && Values.getBoolean(request.getParameter("sendMessagesAsEmail"))); |
7499 |
06 Aug 18 |
nicklas |
96 |
if (useDeviceVerification && !user.getUseDeviceVerification()) |
7499 |
06 Aug 18 |
nicklas |
97 |
{ |
7499 |
06 Aug 18 |
nicklas |
98 |
// Send a verification code for verifying the email address |
7499 |
06 Aug 18 |
nicklas |
99 |
forward = "verify_email.jsp?ID="+ID; |
7499 |
06 Aug 18 |
nicklas |
100 |
} |
7410 |
09 Oct 17 |
nicklas |
101 |
} |
7499 |
06 Aug 18 |
nicklas |
102 |
user.setOrganisation(Values.getStringOrNull(request.getParameter("organisation"))); |
7499 |
06 Aug 18 |
nicklas |
103 |
user.setAddress(Values.getStringOrNull(request.getParameter("address"))); |
7499 |
06 Aug 18 |
nicklas |
104 |
user.setPhone(Values.getStringOrNull(request.getParameter("phone"))); |
7499 |
06 Aug 18 |
nicklas |
105 |
user.setFax(Values.getStringOrNull(request.getParameter("fax"))); |
7499 |
06 Aug 18 |
nicklas |
106 |
user.setUrl(Values.getStringOrNull(request.getParameter("url"))); |
7499 |
06 Aug 18 |
nicklas |
107 |
|
7499 |
06 Aug 18 |
nicklas |
108 |
// Password tab |
7499 |
06 Aug 18 |
nicklas |
109 |
String password = Values.getStringOrNull(request.getParameter("password")); |
7499 |
06 Aug 18 |
nicklas |
110 |
if (password != null) user.setPassword(password); |
7499 |
06 Aug 18 |
nicklas |
111 |
|
7499 |
06 Aug 18 |
nicklas |
112 |
// Other settings tab |
7499 |
06 Aug 18 |
nicklas |
113 |
user.setDescription(Values.getStringOrNull(request.getParameter("description"))); |
7499 |
06 Aug 18 |
nicklas |
114 |
|
7499 |
06 Aug 18 |
nicklas |
115 |
// Extended properties |
7499 |
06 Aug 18 |
nicklas |
116 |
List<ExtendedProperty> extendedProperties = ExtendedProperties.getProperties("UserData", true); |
7499 |
06 Aug 18 |
nicklas |
117 |
if (extendedProperties != null) |
5443 |
07 Oct 10 |
nicklas |
118 |
{ |
7499 |
06 Aug 18 |
nicklas |
119 |
Map<String, String[]> parameters = request.getParameterMap(); |
7499 |
06 Aug 18 |
nicklas |
120 |
for (ExtendedProperty ep : extendedProperties) |
7496 |
11 Jul 18 |
nicklas |
121 |
{ |
7499 |
06 Aug 18 |
nicklas |
122 |
if (ep.isRestrictedEdit()) continue; |
7499 |
06 Aug 18 |
nicklas |
123 |
String name = ep.getName(); |
7499 |
06 Aug 18 |
nicklas |
124 |
if (parameters.containsKey("ep."+name)) |
7499 |
06 Aug 18 |
nicklas |
125 |
{ |
7604 |
25 Feb 19 |
nicklas |
126 |
Formatter<?> formatter = FormatterFactory.getExtendedPropertyFormatter(sc, ep); |
7499 |
06 Aug 18 |
nicklas |
127 |
Object value = formatter.parseString(Values.getStringOrNull(request.getParameter("ep."+name))); |
7499 |
06 Aug 18 |
nicklas |
128 |
user.setExtended(name, value); |
7499 |
06 Aug 18 |
nicklas |
129 |
} |
7496 |
11 Jul 18 |
nicklas |
130 |
} |
5443 |
07 Oct 10 |
nicklas |
131 |
} |
7499 |
06 Aug 18 |
nicklas |
132 |
|
7499 |
06 Aug 18 |
nicklas |
133 |
// OnSave extensions |
7499 |
06 Aug 18 |
nicklas |
134 |
invoker.render(OnSaveRenderer.ON_SAVE); |
7499 |
06 Aug 18 |
nicklas |
135 |
dc.commit(); |
7499 |
06 Aug 18 |
nicklas |
136 |
invoker.render(OnSaveRenderer.ON_COMMIT); |
7499 |
06 Aug 18 |
nicklas |
137 |
message = "Information saved"; |
5443 |
07 Oct 10 |
nicklas |
138 |
} |
7499 |
06 Aug 18 |
nicklas |
139 |
catch (Exception ex) |
7499 |
06 Aug 18 |
nicklas |
140 |
{ |
7499 |
06 Aug 18 |
nicklas |
141 |
invoker.render(OnSaveRenderer.onRollback(ex)); |
7499 |
06 Aug 18 |
nicklas |
142 |
throw ex; |
7499 |
06 Aug 18 |
nicklas |
143 |
} |
7499 |
06 Aug 18 |
nicklas |
144 |
finally |
7499 |
06 Aug 18 |
nicklas |
145 |
{ |
7499 |
06 Aug 18 |
nicklas |
146 |
sc.setSessionSetting("user", null); |
7499 |
06 Aug 18 |
nicklas |
147 |
} |
228 |
23 Mar 05 |
nicklas |
148 |
} |
7410 |
09 Oct 17 |
nicklas |
149 |
else if ("VerifyEmail".equals(cmd)) |
7410 |
09 Oct 17 |
nicklas |
150 |
{ |
7410 |
09 Oct 17 |
nicklas |
151 |
String verificationCode = request.getParameter("verificationCode"); |
7605 |
26 Feb 19 |
nicklas |
152 |
User user = sc.getSessionSetting("user"); |
7410 |
09 Oct 17 |
nicklas |
153 |
dc.reattachItem(user, false); |
7410 |
09 Oct 17 |
nicklas |
154 |
user.enableDeviceVerification(verificationCode); |
7410 |
09 Oct 17 |
nicklas |
155 |
message = "The email has been verified"; |
7410 |
09 Oct 17 |
nicklas |
156 |
dc.commit(); |
7410 |
09 Oct 17 |
nicklas |
157 |
} |
419 |
19 Apr 05 |
nicklas |
158 |
else if ("SavePreferences".equals(cmd)) |
419 |
19 Apr 05 |
nicklas |
159 |
{ |
7499 |
06 Aug 18 |
nicklas |
160 |
User user = User.getById(dc, sc.getLoggedInUserId()); |
7499 |
06 Aug 18 |
nicklas |
161 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, null, user); |
7605 |
26 Feb 19 |
nicklas |
162 |
ExtensionsInvoker<OnSaveAction> invoker = ExtensionsControl.useExtensions(jspContext, EditUtil.EP_PREFIX_SAVE+"user-information"); |
7499 |
06 Aug 18 |
nicklas |
163 |
try |
7499 |
06 Aug 18 |
nicklas |
164 |
{ |
7499 |
06 Aug 18 |
nicklas |
165 |
int newScale = Values.getInt(request.getParameter("scale"), 100); |
7499 |
06 Aug 18 |
nicklas |
166 |
sc.setUserClientSetting("appearance.scale", Integer.toString(newScale)); |
7499 |
06 Aug 18 |
nicklas |
167 |
sc.setUserClientSetting("appearance.fontsize", Values.getString(request.getParameter("fontsize"), "size_m.css")); |
7717 |
22 May 19 |
nicklas |
168 |
sc.setSessionSetting("appearance.scale", newScale / 100.0f); |
7499 |
06 Aug 18 |
nicklas |
169 |
sc.setUserClientSetting("text.long", request.getParameter("longTexts")); |
7499 |
06 Aug 18 |
nicklas |
170 |
ItemContext cc = sc.getCurrentContext(Item.USERCLIENTSETTING); |
7499 |
06 Aug 18 |
nicklas |
171 |
int maxRecent = Base.getMaxRecent(sc); |
7499 |
06 Aug 18 |
nicklas |
172 |
|
7499 |
06 Aug 18 |
nicklas |
173 |
String toolbar = request.getParameter("toolbar"); |
7499 |
06 Aug 18 |
nicklas |
174 |
boolean hasImages = true; |
7499 |
06 Aug 18 |
nicklas |
175 |
boolean hasText = true; |
7499 |
06 Aug 18 |
nicklas |
176 |
if ("text".equals(toolbar)) |
7499 |
06 Aug 18 |
nicklas |
177 |
{ |
7499 |
06 Aug 18 |
nicklas |
178 |
hasImages = false; |
7499 |
06 Aug 18 |
nicklas |
179 |
} |
7499 |
06 Aug 18 |
nicklas |
180 |
else if ("images".equals(toolbar)) |
7499 |
06 Aug 18 |
nicklas |
181 |
{ |
7499 |
06 Aug 18 |
nicklas |
182 |
hasText = false; |
7499 |
06 Aug 18 |
nicklas |
183 |
} |
7499 |
06 Aug 18 |
nicklas |
184 |
sc.setUserClientSetting("toolbar.images", hasImages ? "1" : "0"); |
7499 |
06 Aug 18 |
nicklas |
185 |
sc.setUserClientSetting("toolbar.text", hasText ? "1" : "0"); |
7499 |
06 Aug 18 |
nicklas |
186 |
String minColor = Values.getString(request.getParameter("mincolor"), "0000FF"); |
7499 |
06 Aug 18 |
nicklas |
187 |
String midColor = Values.getString(request.getParameter("midcolor"), "FFFFFF"); |
7499 |
06 Aug 18 |
nicklas |
188 |
String maxColor = Values.getString(request.getParameter("maxcolor"), "FFFF00"); |
7499 |
06 Aug 18 |
nicklas |
189 |
sc.setUserClientSetting("ratiocolor.min", minColor); |
7499 |
06 Aug 18 |
nicklas |
190 |
sc.setUserClientSetting("ratiocolor.mid", midColor); |
7499 |
06 Aug 18 |
nicklas |
191 |
sc.setUserClientSetting("ratiocolor.max", maxColor); |
7499 |
06 Aug 18 |
nicklas |
192 |
cc.setRecent("colors", minColor + "," + midColor + "," + maxColor, maxRecent); |
7499 |
06 Aug 18 |
nicklas |
193 |
|
7499 |
06 Aug 18 |
nicklas |
194 |
String dateFormat = request.getParameter("date_format"); |
7499 |
06 Aug 18 |
nicklas |
195 |
String dateTimeFormat = request.getParameter("datetime_format"); |
7499 |
06 Aug 18 |
nicklas |
196 |
FormatterSettings.setDateFormat(sc, dateFormat); |
7499 |
06 Aug 18 |
nicklas |
197 |
FormatterSettings.setDateTimeFormat(sc, dateTimeFormat); |
7499 |
06 Aug 18 |
nicklas |
198 |
cc.setRecent("dateFormats", dateFormat, maxRecent); |
7499 |
06 Aug 18 |
nicklas |
199 |
cc.setRecent("dateTimeFormats", dateTimeFormat, maxRecent); |
2733 |
16 Oct 06 |
nicklas |
200 |
|
7499 |
06 Aug 18 |
nicklas |
201 |
int numDecimals = Values.getInt(request.getParameter("decimals"), 2); |
7499 |
06 Aug 18 |
nicklas |
202 |
FormatterSettings.setNumDecimals(sc, numDecimals); |
7499 |
06 Aug 18 |
nicklas |
203 |
|
8144 |
21 Apr 23 |
nicklas |
204 |
String ts = Values.getString(request.getParameter("thousands_separator")); |
8144 |
21 Apr 23 |
nicklas |
205 |
FormatterSettings.setThousandsSeparator(sc, ts==null || ts.length()==0 ? null : ts.charAt(0)); |
8144 |
21 Apr 23 |
nicklas |
206 |
|
7499 |
06 Aug 18 |
nicklas |
207 |
sc.setUserClientSetting("dialogs.remember-positions", Values.getBoolean(request.getParameter("remember_positions")) ? "1" : "0"); |
7499 |
06 Aug 18 |
nicklas |
208 |
|
7499 |
06 Aug 18 |
nicklas |
209 |
sc.setUserClientSetting("start-page-id", Values.getStringOrNull(request.getParameter("start_page"))); |
7499 |
06 Aug 18 |
nicklas |
210 |
|
7499 |
06 Aug 18 |
nicklas |
211 |
// Plugins tab |
7499 |
06 Aug 18 |
nicklas |
212 |
sc.setUserClientSetting("plugins.sendmessage", Values.getString(request.getParameter("sendmessage"), "0")); |
7499 |
06 Aug 18 |
nicklas |
213 |
sc.setUserClientSetting("plugins.removejob", Values.getString(request.getParameter("removejob"), "0")); |
7499 |
06 Aug 18 |
nicklas |
214 |
sc.setUserClientSetting("plugins.showWarnings", Values.getString(request.getParameter("show_warnings"), "0")); |
7499 |
06 Aug 18 |
nicklas |
215 |
|
7499 |
06 Aug 18 |
nicklas |
216 |
// Recent items tab |
7499 |
06 Aug 18 |
nicklas |
217 |
int newMaxUsed = Values.getInt(request.getParameter("maxUsed"), 4); |
7499 |
06 Aug 18 |
nicklas |
218 |
sc.setUserClientSetting("appearance.recent", Integer.toString(newMaxUsed)); |
7499 |
06 Aug 18 |
nicklas |
219 |
sc.setSessionSetting("appearance.recent", newMaxUsed); |
7499 |
06 Aug 18 |
nicklas |
220 |
int newMaxViewed = Values.getInt(request.getParameter("maxViewed"), 6); |
7499 |
06 Aug 18 |
nicklas |
221 |
sc.setUserClientSetting("menu.mostRecent.maxViewed", Integer.toString(newMaxViewed)); |
7499 |
06 Aug 18 |
nicklas |
222 |
sc.setUserClientSetting("menu.mostRecent.loadNames", Values.getString(request.getParameter("loadNames"), "0")); |
7499 |
06 Aug 18 |
nicklas |
223 |
|
7499 |
06 Aug 18 |
nicklas |
224 |
String[] stickyItems = request.getParameterValues("sticky_items"); |
7499 |
06 Aug 18 |
nicklas |
225 |
sc.setUserClientSetting("menu.mostRecent", |
7499 |
06 Aug 18 |
nicklas |
226 |
stickyItems == null ? "" : Values.getString(Arrays.asList(stickyItems), ":", true)); |
7499 |
06 Aug 18 |
nicklas |
227 |
|
7499 |
06 Aug 18 |
nicklas |
228 |
// Roles tab |
7499 |
06 Aug 18 |
nicklas |
229 |
String[] inactiveRoles = request.getParameterValues("inactiveRoles"); |
7499 |
06 Aug 18 |
nicklas |
230 |
sc.setUserClientSetting("inactiveRoles", inactiveRoles == null ? null : Values.getString(Arrays.asList(inactiveRoles), ":", true)); |
7499 |
06 Aug 18 |
nicklas |
231 |
|
7499 |
06 Aug 18 |
nicklas |
232 |
// OnSave extensions |
7499 |
06 Aug 18 |
nicklas |
233 |
invoker.render(OnSaveRenderer.ON_SAVE); |
7499 |
06 Aug 18 |
nicklas |
234 |
dc.commit(); |
7499 |
06 Aug 18 |
nicklas |
235 |
invoker.render(OnSaveRenderer.ON_COMMIT); |
7499 |
06 Aug 18 |
nicklas |
236 |
message = "Preferences saved"; |
2189 |
25 Apr 06 |
nicklas |
237 |
} |
7499 |
06 Aug 18 |
nicklas |
238 |
catch (Exception ex) |
2189 |
25 Apr 06 |
nicklas |
239 |
{ |
7499 |
06 Aug 18 |
nicklas |
240 |
invoker.render(OnSaveRenderer.onRollback(ex)); |
7499 |
06 Aug 18 |
nicklas |
241 |
throw ex; |
2189 |
25 Apr 06 |
nicklas |
242 |
} |
419 |
19 Apr 05 |
nicklas |
243 |
} |
966 |
20 Jul 05 |
nicklas |
244 |
else if ("ReloadPermissions".equals(cmd)) |
966 |
20 Jul 05 |
nicklas |
245 |
{ |
966 |
20 Jul 05 |
nicklas |
246 |
sc.reloadPermissions(); |
2001 |
16 Feb 06 |
nicklas |
247 |
sc.reloadSettings(true, false); |
966 |
20 Jul 05 |
nicklas |
248 |
sc.setSessionSetting("menu.standard.html", null); |
966 |
20 Jul 05 |
nicklas |
249 |
message = "Permissions reloaded"; |
966 |
20 Jul 05 |
nicklas |
250 |
} |
4376 |
04 Jul 08 |
nicklas |
251 |
else if ("ResetFilters".equals(cmd)) |
4376 |
04 Jul 08 |
nicklas |
252 |
{ |
4376 |
04 Jul 08 |
nicklas |
253 |
boolean inDatabase = Values.getBoolean(request.getParameter("database")); |
5203 |
16 Dec 09 |
nicklas |
254 |
String itemType = Values.getStringOrNull(request.getParameter("item_type")); |
5203 |
16 Dec 09 |
nicklas |
255 |
Item item = itemType == null ? null : Item.valueOf(itemType); |
5203 |
16 Dec 09 |
nicklas |
256 |
int numDeleted = sc.deleteCurrentContexts(item, true, inDatabase); |
4376 |
04 Jul 08 |
nicklas |
257 |
message = numDeleted + " list settings deleted"; |
4376 |
04 Jul 08 |
nicklas |
258 |
} |
4376 |
04 Jul 08 |
nicklas |
259 |
else |
4376 |
04 Jul 08 |
nicklas |
260 |
{ |
4376 |
04 Jul 08 |
nicklas |
261 |
throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd); |
4376 |
04 Jul 08 |
nicklas |
262 |
} |
228 |
23 Mar 05 |
nicklas |
263 |
} |
228 |
23 Mar 05 |
nicklas |
264 |
finally |
228 |
23 Mar 05 |
nicklas |
265 |
{ |
228 |
23 Mar 05 |
nicklas |
266 |
if (dc != null) dc.close(); |
228 |
23 Mar 05 |
nicklas |
267 |
} |
7410 |
09 Oct 17 |
nicklas |
268 |
|
7410 |
09 Oct 17 |
nicklas |
269 |
if (forward != null) |
7410 |
09 Oct 17 |
nicklas |
270 |
{ |
7410 |
09 Oct 17 |
nicklas |
271 |
pageContext.forward(forward); |
7410 |
09 Oct 17 |
nicklas |
272 |
} |
7410 |
09 Oct 17 |
nicklas |
273 |
else |
7410 |
09 Oct 17 |
nicklas |
274 |
{ |
7410 |
09 Oct 17 |
nicklas |
275 |
response.sendRedirect(root + "common/close_popup.jsp?ID="+ID+"&refresh_opener=1&&message="+HTML.urlEncode(message)); |
7410 |
09 Oct 17 |
nicklas |
276 |
} |
228 |
23 Mar 05 |
nicklas |
277 |
%> |
228 |
23 Mar 05 |
nicklas |
278 |
|