use of org.openforis.collect.web.controller.UserController.UserForm in project collect by openforis.
the class SessionController method getLoggedUser.
@RequestMapping(value = "user", method = GET)
@ResponseBody
public UserForm getLoggedUser(HttpServletRequest request, HttpServletResponse response) {
SessionState sessionState = sessionManager.getSessionState();
User user = sessionState == null ? null : sessionState.getUser();
if (user == null) {
HttpResponses.setNoContentStatus(response);
return null;
}
if (sessionState.getLocale() == null) {
sessionState.setLocale(request.getLocale());
}
return new UserController.UserForm(user);
}
use of org.openforis.collect.web.controller.UserController.UserForm in project collect by openforis.
the class SessionController method initialize.
@RequestMapping(value = "initialize", method = POST)
@ResponseBody
public UserForm initialize(HttpServletRequest request) {
SessionState sessionState = sessionManager.getSessionState();
User user = sessionState.getUser();
sessionState.setLocale(request.getLocale());
return new UserController.UserForm(user);
}
Aggregations