{
userManager.setPassword(userName, null, password);
audit.logAdminCredentialActivity(actionRequest.getUserPrincipal().getName(), getIPAddress(actionRequest), userName, AuditActivity.PASSWORD_RESET, USER_ADMINISTRATION);
passwordSet = true;
}
PasswordCredential credential = getCredential(actionRequest, userName);
if ( credential != null )
{
String updateRequiredStr = actionRequest.getParameter("user_cred_updreq");
if (updateRequiredStr != null)
{
boolean updateRequired = Boolean.valueOf(updateRequiredStr).booleanValue();
if (updateRequired != credential.isUpdateRequired())
{
userManager.setPasswordUpdateRequired(userName,updateRequired);
audit.logAdminCredentialActivity(actionRequest.getUserPrincipal().getName(), getIPAddress(actionRequest), userName, AuditActivity.PASSWORD_UPDATE_REQUIRED, USER_ADMINISTRATION);
}
}
String enabledStr = actionRequest.getParameter("user_cred_enabled");
if (enabledStr != null)
{
boolean enabled = Boolean.valueOf(enabledStr).booleanValue();
if (enabled != credential.isEnabled())
{
userManager.setPasswordEnabled(userName,enabled);
String activity = (enabled) ? AuditActivity.PASSWORD_ENABLED : AuditActivity.PASSWORD_DISABLED;
audit.logAdminCredentialActivity(actionRequest.getUserPrincipal().getName(), getIPAddress(actionRequest), userName, activity, USER_ADMINISTRATION);
}