From: <fxp...@us...> - 2011-03-08 14:29:15
|
Revision: 7421 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=7421&view=rev Author: fxprunayre Date: 2011-03-08 14:29:09 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Add user information in xml.user.login response. See #464. Modified Paths: -------------- trunk/web/src/main/java/org/fao/geonet/constants/Params.java trunk/web/src/main/java/org/fao/geonet/services/login/Login.java Modified: trunk/web/src/main/java/org/fao/geonet/constants/Params.java =================================================================== --- trunk/web/src/main/java/org/fao/geonet/constants/Params.java 2011-03-08 13:55:52 UTC (rev 7420) +++ trunk/web/src/main/java/org/fao/geonet/constants/Params.java 2011-03-08 14:29:09 UTC (rev 7421) @@ -112,6 +112,7 @@ public static final String FAIL_ON_ERROR = "failOnError"; public static final String FAVICON = "favicon"; public static final String SAVE = "save"; + public static final String INFO = "info"; public class Access { Modified: trunk/web/src/main/java/org/fao/geonet/services/login/Login.java =================================================================== --- trunk/web/src/main/java/org/fao/geonet/services/login/Login.java 2011-03-08 13:55:52 UTC (rev 7420) +++ trunk/web/src/main/java/org/fao/geonet/services/login/Login.java 2011-03-08 14:29:09 UTC (rev 7421) @@ -58,11 +58,11 @@ //--- Service //--- //-------------------------------------------------------------------------- - public Element exec(Element params, ServiceContext context) throws Exception { String username = Util.getParam(params, Params.USERNAME); String password = Util.getParam(params, Params.PASSWORD); + String userinfo = Util.getParam(params, Params.INFO, "false"); GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME); SettingManager sm = gc.getSettingManager(); @@ -104,8 +104,14 @@ context.info("User '"+ username +"' logged in as '"+ sProfile +"'"); context.getUserSession().authenticate(sId, username, sName, sSurname, sProfile); - - return new Element("ok"); + + if ("false".equals(userinfo)) { + return new Element("ok"); + } else { + user.removeChildren("password"); + return new Element("ok") + .addContent(user.detach()); + } } //-------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |