%--
- $Revision$
- $Date$
-
- Copyright (C) 2004-2008 Jive Software. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--%>
<%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.LocaleUtils,
org.jivesoftware.util.Log,
org.jivesoftware.util.ParamUtils"
%>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Locale"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.TimeZone"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<% webManager.init(request, response, session, application, out ); %>
<% // Get parameters //
String localeCode = ParamUtils.getParameter(request,"localeCode");
String timeZoneID = ParamUtils.getParameter(request,"timeZoneID");
boolean save = request.getParameter("save") != null;
// TODO: We're not displaying this error ever.
Map errors = new HashMap();
if (save) {
// Set the timezeone
try {
TimeZone tz = TimeZone.getTimeZone(timeZoneID);
JiveGlobals.setTimeZone(tz);
// Log the event
webManager.logEvent("updated time zone to "+tz.getID(), tz.toString());
}
catch (Exception e) {
Log.error(e);
}
if (localeCode != null) {
Locale newLocale = LocaleUtils.localeCodeToLocale(localeCode.trim());
if (newLocale == null) {
errors.put("localeCode","");
}
else {
JiveGlobals.setLocale(newLocale);
// Log the event
webManager.logEvent("updated locale to "+newLocale.getDisplayName(), null);
response.sendRedirect("server-locale.jsp?success=true");
return;
}
}
}
Locale locale = JiveGlobals.getLocale();
// Get the time zone list.
String[][] timeZones = LocaleUtils.getTimeZoneList();
// Get the current time zone.
TimeZone timeZone = JiveGlobals.getTimeZone();
%>