private void updateUserAttribute(ActionRequest actionRequest, ActionResponse actionResponse)
{
String userName = (String)PortletMessaging.receive(actionRequest,
SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED);
User user = lookupUser(actionRequest, userName);
if (user != null)
{
String[] userAttrNames = actionRequest.getParameterValues("user_attr_id");
if(userAttrNames != null)
{
for (int i=0; i<userAttrNames.length; i++)
{
String userAttrName = userAttrNames[i];
String value = actionRequest.getParameter(userAttrName + ":value");
String before = user.getUserAttributes().get(userAttrName, "");
user.getUserAttributes().put(userAttrName, value);
audit.logAdminAttributeActivity(actionRequest.getUserPrincipal().getName(), getIPAddress(actionRequest), userName, AuditActivity.USER_UPDATE_ATTRIBUTE, userAttrName, before, value, USER_ADMINISTRATION);
}
}
}
}