NIHVIVO-2684 If first name and last name are both empty, display the emailAddress.
This commit is contained in:
parent
f4ae63a309
commit
0756aac8b0
1 changed files with 11 additions and 2 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue