%--
- $Revision$
- $Date$
-
- Copyright (C) 2004-2005 Jive Software. All rights reserved.
-
- This software is published under the terms of the GNU Public License (GPL),
- a copy of which is included in this distribution.
--%>
<%@ page import="org.jivesoftware.util.*,
org.jivesoftware.openfire.user.*,
org.jivesoftware.admin.AdminPageBean,
java.net.URLEncoder"
errorPage="error.jsp"
%><%@ page import="org.xmpp.packet.JID"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<% // Get parameters //
boolean cancel = request.getParameter("cancel") != null;
boolean update = request.getParameter("update") != null;
String username = ParamUtils.getParameter(request,"username");
String password = ParamUtils.getParameter(request,"password");
String passwordConfirm = ParamUtils.getParameter(request,"passwordConfirm");
// Handle a cancel
if (cancel) {
response.sendRedirect("user-properties.jsp?username=" + URLEncoder.encode(username, "UTF-8"));
return;
}
// Load the user object
User user = admin.getUserManager().getUser(username);
// Handle a password update:
boolean errors = false;
if (update) {
// Validate the passwords:
if (password != null && passwordConfirm != null && password.equals(passwordConfirm)) {
user.setPassword(password);
// Done, so redirect
response.sendRedirect("user-password.jsp?success=true&username=" + URLEncoder.encode(username, "UTF-8"));
return;
}
else {
errors = true;
}
}
%>
"/>
<% if (UserManager.getUserProvider().isReadOnly()) { %>
<% } %>
<% if (errors) { %>
<% } else if (request.getParameter("success") != null) { %>
<% } %>
<% // Disable the form if a read-only user provider.
if (UserManager.getUserProvider().isReadOnly()) { %>
<% } %>