Skip to content
Snippets Groups Projects
Commit 89e051f5 authored by Alinga Yeung's avatar Alinga Yeung
Browse files

Story ac2. Added PasswordServlet to provide setPassword service.

parent 469163fc
No related branches found
No related tags found
No related merge requests found
......@@ -235,6 +235,34 @@ public class LdapUserPersistence<T extends Principal>
}
}
}
/**
* Update a user's password. The given user and authenticating user must match.
*
* @param user
* @param oldPassword current password.
* @param newPassword new password.
* @throws UserNotFoundException If the given user does not exist.
* @throws TransientException If an temporary, unexpected problem occurred.
* @throws AccessControlException If the operation is not permitted.
*/
public void setPassword(User<T> user, final String oldPassword, final String newPassword)
throws UserNotFoundException, TransientException, AccessControlException
{
LdapUserDAO<T> userDAO = null;
try
{
userDAO = new LdapUserDAO<T>(this.config);
userDAO.setPassword(user, oldPassword, newPassword);
}
finally
{
if (userDAO != null)
{
userDAO.close();
}
}
}
/**
* Delete the user specified by userID.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment