{
typeOfSave = request.getParameter("buttonpress");
}
UserHome uhome = (UserHome)CVUtility.getHomeObject("com.centraview.administration.user.UserHome", "User");
User uRemote = (User)uhome.create();
uRemote.setDataSource(dataSource);
String oldPassword = "", newPassword = "";
// TODO integrate password change with RememberMe functionallity.
if (uRemote != null)
{
oldPassword = (String)request.getParameter("oldpassword");
newPassword = (String)request.getParameter("newpassword");
}
if (newPassword != null && newPassword.length() != 0)
{
try
{
uRemote.changePassword(individualId, oldPassword, newPassword);
} catch (UserException ue) {
if (ue.getExceptionId() == UserException.COULDNOT_CHANGE_PASSWORD)
{
allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm",
"Error while updating login information, " + ue.getExceptionDescription()));