/** 查看留言回复 */
 @RequestMapping(value = "/member/guestbook_replay.jspx")
 public String guestbook_replay(
     Integer id,
     String nextUrl,
     HttpServletRequest request,
     HttpServletResponse response,
     ModelMap model) {
   CmsSite site = CmsUtils.getSite(request);
   CmsUser user = CmsUtils.getUser(request);
   FrontUtils.frontData(request, model, site);
   MemberConfig mcfg = site.getConfig().getMemberConfig();
   // 没有开启会员功能
   if (!mcfg.isMemberOn()) {
     return FrontUtils.showMessage(request, model, "member.memberClose");
   }
   if (user == null) {
     return FrontUtils.showLogin(request, model, site);
   }
   CmsGuestbook guestbook = guestbookMng.findById(id);
   if (!guestbook.getMember().equals(user)) {
     WebErrors errors = WebErrors.create(request);
     errors.addErrorCode("error.noPermissionsView");
     return FrontUtils.showError(request, response, model, errors);
   }
   model.addAttribute("guestbook", guestbook);
   return FrontUtils.getTplPath(
       request, site.getSolutionPath(), TPLDIR_GUESTBOOK, GUESTBOOK_REPLAY);
 }
示例#2
0
 /**
  * 密码修改提交页
  *
  * @param origPwd 原始密码
  * @param newPwd 新密码
  * @param email 邮箱
  * @param nextUrl 下一个页面地址
  * @param request
  * @param response
  * @param model
  * @return
  * @throws IOException
  */
 @RequestMapping(value = "/member/pwd.jspx", method = RequestMethod.POST)
 public String passwordSubmit(
     String origPwd,
     String newPwd,
     String email,
     String nextUrl,
     HttpServletRequest request,
     HttpServletResponse response,
     ModelMap model)
     throws IOException {
   CmsSite site = CmsUtils.getSite(request);
   CmsUser user = CmsUtils.getUser(request);
   FrontUtils.frontData(request, model, site);
   MemberConfig mcfg = site.getConfig().getMemberConfig();
   // 没有开启会员功能
   if (!mcfg.isMemberOn()) {
     return FrontUtils.showMessage(request, model, "member.memberClose");
   }
   if (user == null) {
     return FrontUtils.showLogin(request, model, site);
   }
   WebErrors errors = validatePasswordSubmit(user.getId(), origPwd, newPwd, email, request);
   if (errors.hasErrors()) {
     return FrontUtils.showError(request, response, model, errors);
   }
   cmsUserMng.updatePwdEmail(user.getId(), newPwd, email);
   return FrontUtils.showSuccess(request, model, nextUrl);
 }
示例#3
0
 @RequestMapping(value = "/vote_reply_view.jspx", method = RequestMethod.GET)
 public String reply_view(
     Integer subId,
     Integer pageNo,
     HttpServletRequest request,
     HttpServletResponse response,
     ModelMap model) {
   CmsSite site = CmsUtils.getSite(request);
   CmsVoteSubTopic subTopic = null;
   if (subId != null) {
     subTopic = cmsVoteSubTopicMng.findById(subId);
   }
   if (subTopic != null) {
     Pagination pagination =
         cmsVoteReplyMng.getPage(subId, cpn(pageNo), CookieUtils.getPageSize(request));
     model.addAttribute("subTopic", subTopic);
     model.addAttribute("pagination", pagination);
     FrontUtils.frontData(request, model, site);
     FrontUtils.frontPageData(request, model);
     return FrontUtils.getTplPath(
         request, site.getSolutionPath(), TPLDIR_SPECIAL, VOTE_REPLY_RESULT);
   } else {
     WebErrors errors = WebErrors.create(request);
     errors.addError("error.vote.novotesubfind");
     return FrontUtils.showError(request, response, model, errors);
   }
 }
示例#4
0
 @RequestMapping(value = "/vote.jspx", method = RequestMethod.GET)
 public String input(
     Integer voteId, HttpServletRequest request, HttpServletResponse response, ModelMap model) {
   CmsSite site = CmsUtils.getSite(request);
   CmsVoteTopic vote = null;
   if (voteId != null) {
     vote = cmsVoteTopicMng.findById(voteId);
   }
   if (vote != null) {
     model.addAttribute("vote", vote);
     FrontUtils.frontData(request, model, site);
     return FrontUtils.getTplPath(request, site.getSolutionPath(), TPLDIR_SPECIAL, VOTE_INPUT);
   } else {
     WebErrors errors = WebErrors.create(request);
     errors.addError("error.vote.novotefind");
     return FrontUtils.showError(request, response, model, errors);
   }
 }