Пример #1
0
 @RequestMapping(value = "/topic/search*.jhtml")
 public String searchSubmit(Integer pageNo, HttpServletRequest request, ModelMap model) {
   CmsSite site = CmsUtils.getSite(request);
   FrontUtils.frontData(request, model, site);
   String keywords = RequestUtils.getQueryParam(request, "keywords");
   String forumIdStr = RequestUtils.getQueryParam(request, "forumId");
   Integer forumId = 0;
   if (forumIdStr != null && StringUtils.isNotBlank(forumIdStr)) {
     forumId = Integer.parseInt(forumIdStr);
   }
   model.put("keywords", keywords);
   model.put("forumId", forumId);
   FrontUtils.frontPageData(request, model);
   return FrontUtils.getTplPath(request, site, TPLDIR_SPECIAL, SEARCH_RESULT);
 }
Пример #2
0
 @RequestMapping(value = "/data/v_rename.do")
 public String renameInput(HttpServletRequest request, ModelMap model) {
   String name = RequestUtils.getQueryParam(request, "name");
   String origName = name.substring(Constants.BACKUP_PATH.length());
   model.addAttribute("origName", origName);
   return "data/rename";
 }
Пример #3
0
 @RequestMapping("/data/o_delete_single.do")
 public String deleteSingle(
     HttpServletRequest request, ModelMap model, HttpServletResponse response) {
   // TODO 输入验证
   String name = RequestUtils.getQueryParam(request, "name");
   int count = resourceMng.delete(new String[] {name});
   log.info("delete Resource {}, count {}", name, count);
   cmsLogMng.operating(request, "resource.log.delete", "filename=" + name);
   return listBackUpFiles(model, request, response);
 }
Пример #4
0
 @RequiresPermissions("data:o_delete_single")
 @RequestMapping("/mysql/data/o_delete_single.do")
 public String deleteSingle(
     HttpServletRequest request, ModelMap model, HttpServletResponse response) {
   String name = RequestUtils.getQueryParam(request, "name");
   WebErrors errors = validateDelete(new String[] {name}, request);
   if (errors.hasErrors()) {
     return errors.showErrorPage(model);
   }
   int count = resourceMng.delete(new String[] {name});
   log.info("delete Resource {}, count {}", name, count);
   cmsLogMng.operating(request, "resource.log.delete", "filename=" + name);
   return listBackUpFiles(model, request, response);
 }
Пример #5
0
 @RequestMapping(value = "/email_unique.jspx")
 public void emailUnique(HttpServletRequest request, HttpServletResponse response) {
   String email = RequestUtils.getQueryParam(request, "email");
   // email为空,返回false。
   if (StringUtils.isBlank(email)) {
     ResponseUtils.renderJson(response, "false");
     return;
   }
   // email存在,返回false。
   if (unifiedUserMng.emailExist(email)) {
     ResponseUtils.renderJson(response, "false");
     return;
   }
   ResponseUtils.renderJson(response, "true");
 }
Пример #6
0
 @RequestMapping(value = "/username_unique.jspx")
 public void usernameUnique(HttpServletRequest request, HttpServletResponse response) {
   String username = RequestUtils.getQueryParam(request, "username");
   // 用户名为空,返回false。
   if (StringUtils.isBlank(username)) {
     ResponseUtils.renderJson(response, "false");
     return;
   }
   // 用户名存在,返回false。
   if (unifiedUserMng.usernameExist(username)) {
     ResponseUtils.renderJson(response, "false");
     return;
   }
   ResponseUtils.renderJson(response, "true");
 }
Пример #7
0
 @RequestMapping(value = "/username_unique.jspx")
 public void usernameUnique(HttpServletRequest request, HttpServletResponse response) {
   String username = RequestUtils.getQueryParam(request, "username");
   // 用户名为空,返回false。
   if (StringUtils.isBlank(username)) {
     ResponseUtils.renderJson(response, "false");
     return;
   }
   CmsSite site = CmsUtils.getSite(request);
   CmsConfig config = site.getConfig();
   // 保留字检查不通过,返回false。
   if (!config.getMemberConfig().checkUsernameReserved(username)) {
     ResponseUtils.renderJson(response, "false");
     return;
   }
   // 用户名存在,返回false。
   if (unifiedUserMng.usernameExist(username)) {
     ResponseUtils.renderJson(response, "false");
     return;
   }
   ResponseUtils.renderJson(response, "true");
 }