Search in sources :

Example 56 with LogOperate

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;
}
Also used : LogOperate(com.publiccms.entities.log.LogOperate) SysSite(com.publiccms.entities.sys.SysSite) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 57 with LogOperate

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;
}
Also used : LogOperate(com.publiccms.entities.log.LogOperate) SysSite(com.publiccms.entities.sys.SysSite) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 58 with LogOperate

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;
}
Also used : LogOperate(com.publiccms.entities.log.LogOperate) SysApp(com.publiccms.entities.sys.SysApp) SysSite(com.publiccms.entities.sys.SysSite) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 59 with LogOperate

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;
}
Also used : LogOperate(com.publiccms.entities.log.LogOperate) SysAppClient(com.publiccms.entities.sys.SysAppClient) SysSite(com.publiccms.entities.sys.SysSite) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 60 with LogOperate

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;
    }
}
Also used : LogOperate(com.publiccms.entities.log.LogOperate) CmsPlace(com.publiccms.entities.cms.CmsPlace) SysUser(com.publiccms.entities.sys.SysUser) CmsPlaceMetadata(com.publiccms.views.pojo.entities.CmsPlaceMetadata) SysSite(com.publiccms.entities.sys.SysSite) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

LogOperate (com.publiccms.entities.log.LogOperate)117 SysSite (com.publiccms.entities.sys.SysSite)117 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)115 SysUser (com.publiccms.entities.sys.SysUser)15 IOException (java.io.IOException)13 CmsContent (com.publiccms.entities.cms.CmsContent)9 File (java.io.File)9 MultipartFile (org.springframework.web.multipart.MultipartFile)8 CmsCategory (com.publiccms.entities.cms.CmsCategory)7 TemplateException (freemarker.template.TemplateException)7 SysDept (com.publiccms.entities.sys.SysDept)6 SysTask (com.publiccms.entities.sys.SysTask)6 CmsPageMetadata (com.publiccms.views.pojo.entities.CmsPageMetadata)5 CmsPlaceMetadata (com.publiccms.views.pojo.entities.CmsPlaceMetadata)5 CmsPlace (com.publiccms.entities.cms.CmsPlace)4 CmsWord (com.publiccms.entities.cms.CmsWord)4 SysDomain (com.publiccms.entities.sys.SysDomain)4 SysRoleUser (com.publiccms.entities.sys.SysRoleUser)4 CmsModel (com.publiccms.views.pojo.entities.CmsModel)4 CmsCategoryType (com.publiccms.entities.cms.CmsCategoryType)3