Commit 8fbe6ccc authored by Armando Jagucki's avatar Armando Jagucki Committed by ajagucki

JM-1405: Show an error message when changing the password if the operation is...

JM-1405: Show an error message when changing the password if the operation is unsupported by the AuthProvider (ex. when Clearspace integration is enabled) instead of making a false claim of a successful password change.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10630 b35dd754-fafc-0310-a699-88a17e54d16e
parent a85407c0
......@@ -2264,6 +2264,8 @@ user.message.send_message=Send Message
user.password.title=Change Password
user.password.error_set_pwd=Error setting the password. Please make sure the password you enter is valid \
and matches the confirmation password.
user.password.error_set_pwd_unsupp=Error setting the password. This operation is not supported with your current \
configuration.
user.password.update=Password updated successfully.
user.password.info=Use the form below to change the user's password.
user.password.change=Change Password
......@@ -2916,7 +2918,7 @@ clearspace.status.disconnected.of.description=Please check that the Clearspace U
clearspace.status.error.disconnected.cs=Clearspace is not connected to Openfire.
clearspace.status.disconnected.cs.description=The most common reason for this is that Openfire was not able to configure Clearspace. Until that happen Openfire will re-attempt this configuration automatically every minute.
clearspace.status.error.disconnected.of_and_cs=Openfire and Clearspace are not connected.
clearspace.status.disconnected.of_and_cs.description=Please check that Openfire is pointing to the right Clearspace URL and that Openfire and Clearspace have the same shared secret. You can check Openfires configuration {0}here{1}. You can verify Clearspaces configuration by visiting the Clearspace admin console, going to the Real Time tab, and checking under the Connection menu item.
clearspace.status.disconnected.of_and_cs.description=Please check that Openfire is pointing to the right Clearspace URL and that Openfire and Clearspace have the same shared secret. You can check Openfire�s configuration {0}here{1}. You can verify Clearspace�s configuration by visiting the Clearspace admin console, going to the Real Time tab, and checking under the Connection menu item.
clearspace.status.disconnected.buttons.description=You can test Openfire connection or try to force Clearspace configuration by using the following buttons:
clearspace.status.disconnected.testbutton=Test Connection
clearspace.status.disconnected.configbutton=Configure Clearspace
......
......@@ -158,8 +158,9 @@ public class User implements Cacheable, Externalizable, Result {
* Sets a new password for this user.
*
* @param password the new password for the user.
* @throws UnsupportedOperationException
*/
public void setPassword(String password) {
public void setPassword(String password) throws UnsupportedOperationException {
if (UserManager.getUserProvider().isReadOnly()) {
throw new UnsupportedOperationException("User provider is read-only.");
}
......@@ -173,9 +174,6 @@ public class User implements Cacheable, Externalizable, Result {
UserEventDispatcher.dispatchEvent(this, UserEventDispatcher.EventType.user_modified,
params);
}
catch (UnsupportedOperationException uoe) {
Log.error(uoe);
}
catch (UserNotFoundException unfe) {
Log.error(unfe);
}
......
......@@ -39,9 +39,11 @@
// Handle a password update:
boolean errors = false;
boolean unsupported = false;
if (update) {
// Validate the passwords:
if (password != null && passwordConfirm != null && password.equals(passwordConfirm)) {
try {
user.setPassword(password);
if (!SecurityAuditManager.getSecurityAuditProvider().blockUserEvents()) {
// Log the event
......@@ -51,6 +53,10 @@
response.sendRedirect("user-password.jsp?success=true&username=" + URLEncoder.encode(username, "UTF-8"));
return;
}
catch (UnsupportedOperationException uoe) {
unsupported = true;
}
}
else {
errors = true;
}
......@@ -85,6 +91,19 @@
</table>
</div><br>
<% } else if (unsupported) { %>
<div class="jive-error">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0" alt=""></td>
<td class="jive-icon-label">
<fmt:message key="user.password.error_set_pwd_unsupp" />
</td></tr>
</tbody>
</table>
</div><br>
<% } else if (request.getParameter("success") != null) { %>
<div class="jive-success">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment