}
@Override
protected void execute(Panel panel, ShowMonthForm form, ActionMapping mapping, HttpServletRequest request, HttpServletResponse response)
{
UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
boolean update = true;
// Pr�fe ob schon ein Standardkalender besteht
CalendarVO calendar = (CalendarVO) panel.getAttribute("calendar");
ActionMessages errors = getErrors(request);
if(errors.isEmpty()) {
if (form.getId() > 0) {
calendar = new CalendarDAO().getById(form.getId());
if (!EntityAccessUtility.isAccessGranted(activeUser, calendar, EntityAccess.Access.READ)) {
log.debug("user tries to access an invalid calendar");
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", calendar.getId()));
calendar = null;
// refresh the user
UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
user = new UserDAO().getById(user.getId());
if(user != null) {
request.getSession().setAttribute(Globals.USER_KEY, user);
} else {
log.info("could not reload user (may be deleted)");
}