use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class HomeGroupPostAdminController method delete.
/**
* @param ids
* @param request
* @param session
* @return view name
*/
@RequestMapping("delete")
public String delete(Integer[] ids, HttpServletRequest request, HttpSession session) {
SysSite site = getSite(request);
if (CommonUtils.notEmpty(ids)) {
service.delete(ids);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "delete.homeGroupPost", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(ids, ',')));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class LogAdminController method logOperateDelete.
/**
* @param ids
* @param request
* @param session
* @return view name
*/
@RequestMapping("logOperate/delete")
public String logOperateDelete(Long[] ids, HttpServletRequest request, HttpSession session) {
SysSite site = getSite(request);
if (CommonUtils.notEmpty(ids)) {
logOperateService.delete(site.getId(), ids);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "delete.logOperate", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(ids, ',')));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class SysAppAdminController method delete.
/**
* @param id
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("delete")
public String delete(Integer id, HttpServletRequest request, HttpSession session, ModelMap model) {
SysSite site = getSite(request);
SysApp entity = service.getEntity(id);
if (null != entity) {
if (ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getSiteId(), model)) {
return TEMPLATE_ERROR;
}
service.delete(id);
entity.setAppSecret(null);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "delete.app", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class SysAppClientAdminController method enable.
/**
* @param id
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping(value = "enable", method = RequestMethod.POST)
public String enable(Long id, HttpServletRequest request, HttpSession session, ModelMap model) {
SysAppClient entity = service.getEntity(id);
if (null != entity.getId()) {
SysSite site = getSite(request);
if (ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getId().getSiteId(), model)) {
return TEMPLATE_ERROR;
}
service.updateStatus(id, false);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "enable.appclient", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class PlaceController method check.
/**
* @param id
* @param returnUrl
* @param request
* @param session
* @param response
* @param model
* @return view name
*/
@RequestMapping("check")
public String check(Long id, String returnUrl, HttpServletRequest request, HttpSession session, HttpServletResponse response, ModelMap model) {
SysSite site = getSite(request);
if (CommonUtils.empty(returnUrl)) {
returnUrl = site.getDynamicPath();
}
CmsPlace entity = service.getEntity(id);
SysUser user = getUserFromSession(session);
String filePath = siteComponent.getWebTemplateFilePath(site, TemplateComponent.INCLUDE_DIRECTORY + entity.getPath());
CmsPlaceMetadata metadata = metadataComponent.getPlaceMetadata(filePath);
if (ControllerUtils.verifyCustom("manage", null == entity || null == user || CommonUtils.empty(metadata.getAdminIds()) || !ArrayUtils.contains(metadata.getAdminIds(), user.getId()), model) || ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getSiteId(), model)) {
return REDIRECT + returnUrl;
} else {
service.check(id);
logOperateService.save(new LogOperate(site.getId(), user.getId(), LogLoginService.CHANNEL_WEB, "check.place", RequestUtils.getIpAddress(request), CommonUtils.getDate(), id.toString()));
return REDIRECT + returnUrl;
}
}
Aggregations