public ActionForward execute(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   User user = LegacySpringUtils.getUserManager().getLoggedInUser();
   String suppliedOldPassword = BeanUtils.getProperty(form, "oldpassword");
   String actualOldPassword = user.getPassword();
   String hashedSuppliedOldPassword = LogonUtils.hashPassword(suppliedOldPassword);
   if (hashedSuppliedOldPassword.equals(actualOldPassword)) {
     user.setPassword(LogonUtils.hashPassword(BeanUtils.getProperty(form, "passwordPwd")));
     user.setFirstlogon(false);
     LegacySpringUtils.getUserManager().save(user);
     AddLog.addLog(
         user.getUsername(),
         AddLog.PASSWORD_CHANGE,
         user.getUsername(),
         "",
         UserUtils.retrieveUsersRealUnitcodeBestGuess(user.getUsername()),
         "");
     return mapping.findForward("success");
   } else {
     request.setAttribute("error", "incorrect current password");
     return mapping.findForward("input");
   }
 }
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    Long feedbackId = Long.decode(BeanUtils.getProperty(form, "id"));
    String commentedited = BeanUtils.getProperty(form, "commentedited");
    String makepublic = BeanUtils.getProperty(form, "makepublic");
    boolean makepublicBool = "true".equals(makepublic);

    Feedback feedback = LegacySpringUtils.getFeedbackManager().get(feedbackId);

    feedback.setCommentedited(commentedited);
    feedback.setMakepublic(makepublicBool);

    LegacySpringUtils.getFeedbackManager().save(feedback);

    List feedbacks = LegacySpringUtils.getFeedbackManager().get(feedback.getUnitcode());

    request.setAttribute("feedbacks", feedbacks);

    return LogonUtils.logonChecks(mapping, request);
  }
Esempio n. 3
0
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    String screenName = request.getParameter("screenname");
    if (screenName == null || screenName.trim().length() == 0) {
      return mapping.findForward("input");
    }
    User user = LegacySpringUtils.getUserManager().getLoggedInUser();

    if (user != null) {
      user.setScreenname(screenName);
      LegacySpringUtils.getUserManager().save(user);
    }

    setJforumScreenname(user);

    return LogonUtils.logonChecks(mapping, request);
  }