// the user
if (profileName == null) {
// get the profile for the current request
final HttpServletRequest httpServletRequest = portalRequestUtils.getPortletHttpRequest(request);
final IUserInstance ui = userInstanceManager.getUserInstance(httpServletRequest);
final IUserProfile profile = ui.getPreferencesManager().getUserProfile();
// check to see if the profile's fname matches one of the entries in
// the profile key map used by the session attribute profile mapper
for (Map.Entry<String, String> entry : mappings.entrySet()) {
if (entry.getValue().equals(profile.getProfileFname())) {
profileName = entry.getKey();
break;
}
}
}