if (ctx.getExternalContext().getUserPrincipal() == null) {
userCaption = "";//MessageUtils.getMessageResourceString(ctx.getApplication().getMessageBundle(), "not_login_caption", ctx.getViewRoot().getLocale());
} else {
if (loginSession.isLoggedIn()) {
//tady je mozny si usera ulozit do tyhle beany do lokalni promeny ale je to zbytecny protoze je uz v loginsession
User user = loginSession.getUser();
} else {
loginSession.login(ctx.getExternalContext().getUserPrincipal().getName());
User user = loginSession.getUser();
userCaption = user.getFirstName() + " " + user.getLastName();
}
}
return userCaption;
}