}
private static final Log LOG = LogFactory.getLog(UserUtil.class);
public static User getUserFromSession() {
CustomUser loggedUser = SecurityUtils.getLoggedUser();
if (loggedUser != null) {
String username = loggedUser.getUsername();
try {
return Registry.getUserDAO().findByLoginName(username);
} catch (InstanceNotFoundException e) {
LOG.info("User " + username + " not found in database.");
return null;