Skip to content

Commit

Permalink
Add organisation in info?type=me service response
Browse files Browse the repository at this point in the history
  • Loading branch information
fgravin committed May 20, 2015
1 parent 1dcfea8 commit 108431f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
24 changes: 16 additions & 8 deletions core/src/main/java/jeeves/server/UserSession.java
Expand Up @@ -169,14 +169,22 @@ public Profile getProfile() {
return userDetails.getProfile();
}
}
public String getEmailAddr() {
User userDetails = getPrincipal();
if (userDetails == null) {
return null;
} else {
return userDetails.getEmail();
}
}
public String getEmailAddr() {
User userDetails = getPrincipal();
if (userDetails == null) {
return null;
} else {
return userDetails.getEmail();
}
}
public String getOrganisation() {
User userDetails = getPrincipal();
if (userDetails == null) {
return null;
} else {
return userDetails.getOrganisation();
}
}

public int getUserIdAsInt() {
String id = getUserId();
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/org/fao/geonet/constants/Geonet.java
Expand Up @@ -110,7 +110,8 @@ public static final class Elem {
public static final String ID = "id";
public static final String ON = "on";
public static final String METADATA = "metadata";
public static final String NAME = "name";
public static final String NAME = "name";
public static final String ORGANISATION = "organisation";
public static final String NOTIFICATIONS = "notifications";
public static final String SURNAME = "surname";
public static final String PROFILE = "profile";
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/org/fao/geonet/services/main/Info.java
Expand Up @@ -327,7 +327,8 @@ private Element getMyInfo(ServiceContext context) {
.addContent(new Element(Geonet.Elem.ID).setText(userSession.getUserId()))
.addContent(new Element(Geonet.Elem.NAME).setText(userSession.getName()))
.addContent(new Element(Geonet.Elem.SURNAME).setText(userSession.getSurname()))
.addContent(new Element(Geonet.Elem.EMAIL).setText(emailAddr));
.addContent(new Element(Geonet.Elem.EMAIL).setText(emailAddr))
.addContent(new Element(Geonet.Elem.ORGANISATION).setText(userSession.getOrganisation()));

if (emailAddr != null) {
data.addContent(new Element(Geonet.Elem.HASH).setText(org.apache.commons.codec.digest.DigestUtils.md5Hex(emailAddr)));
Expand Down

0 comments on commit 108431f

Please sign in to comment.