NIHVIVO-2684 If first name and last name are both empty, display the emailAddress.

This commit is contained in:
j2blake 2011-06-09 16:28:35 +00:00
parent f4ae63a309
commit 0756aac8b0

View file

@ -28,8 +28,17 @@ public class User extends BaseTemplateModel {
} }
public String getLoginName() { public String getLoginName() {
return (currentUser == null) ? "" if (currentUser == null) {
: (currentUser.getFirstName() + " " + currentUser.getLastName()); return "";
}
String firstName = currentUser.getFirstName();
String lastName = currentUser.getLastName();
if (firstName.isEmpty() && lastName.isEmpty()) {
return currentUser.getEmailAddress();
}
return firstName + " " + lastName;
} }
public boolean getHasSiteAdminAccess() { public boolean getHasSiteAdminAccess() {