use of org.openforis.collect.model.proxy.UserProxy in project collect by openforis.
the class UserService method save.
public UserProxy save(UserProxy user) throws UserPersistenceException {
User u = user.toUser();
userManager.save(u, sessionManager.getLoggedUser());
UserProxy proxy = new UserProxy(u);
return proxy;
}
use of org.openforis.collect.model.proxy.UserProxy in project collect by openforis.
the class SessionService method initSession.
/**
* Set a locale (language, country) into the session state object
*
* @return map with user, sessionId
* @throws DatabaseVersionNotCompatibleException
*/
// @Secured("isAuthenticated()")
public Map<String, Object> initSession(String locale) throws DatabaseVersionNotCompatibleException {
databaseVersionManager.checkIsVersionCompatible();
sessionManager.setLocale(locale);
SessionState sessionState = sessionManager.getSessionState();
User user = sessionState.getUser();
UserProxy userProxy = new UserProxy(user);
String sessionId = sessionState.getSessionId();
Map<String, Object> result = new HashMap<String, Object>();
result.put("user", userProxy);
result.put("sessionId", sessionId);
return result;
}
Aggregations