@RequestParam("longinfo") String longInfo,
@RequestParam(value = "preview", required = false) String preview,
@RequestParam(value = "resolvable", required = false) String resolvable,
ServletRequest request
) throws Exception {
Template tmpl = Template.getTemplate(request);
if (!tmpl.isModeratorSession()) {
throw new AccessViolationException("Not moderator");
}
Group group = groupDao.getGroup(id);
if (preview != null) {
group.setTitle(title);
group.setInfo(info);
group.setLongInfo(longInfo);
Map<String, Object> params = new HashMap<>();
params.put("group", group);
params.put("groupInfo", prepareService.prepareGroupInfo(group, request.isSecure()));
params.put("preview", true);
return new ModelAndView("groupmod", params);
}
groupDao.setParams(group, title, info, longInfo, resolvable!=null, urlName);
logger.info("Настройки группы {} изменены {}", group.getUrlName(), tmpl.getCurrentUser().getNick());
return new ModelAndView("action-done", "message", "Параметры изменены");
}