Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.UserBean


    UserForm user = (UserForm) form;
    super.validateClientId(request, user);
    ActionMessages msgs = new ActionMessages();
   
    while (msgs.isEmpty()) {
      UserBean loginUser = super.getLoginUser(request, response);
      if(loginUser == null) {
        msgs.add("user", new ActionMessage("error.user_not_login"));
        break;
      }
      if(loginUser.getId() != user.getId()){
        msgs.add("user", new ActionMessage("error.access_deny"));
        break;
      }
      UserBean ubean = UserDAO.getUserByID(user.getId());
      if (ubean == null || ubean.getStatus()!=UserBean.STATUS_NORMAL) {
        msgs.add("id", new ActionMessage("error.user_not_available",
            new Integer(user.getId())));
        break;
      }
      if (!StringUtils.equals(ubean.getPassword(), user
          .getPassword())){
        msgs.add("password",
            new ActionMessage("error.user_auth_failed"));
        break;
      }
      if(!StringUtils.equals(user.getHomePage(), ubean.getHomePage())){
        ubean.setHomePage(user.getHomePage());
        try {
          DLOGUserManager.update(ubean);
          //����session�е��û�����
          UserLoginManager.updateLoginUser(request, ubean);   
        } catch (Exception e) {
View Full Code Here


    UserForm user = (UserForm) form;
    super.validateClientId(request, user);
    ActionMessages msgs = new ActionMessages();
   
    while (msgs.isEmpty()) {
      UserBean loginUser = super.getLoginUser(request, response);
      if(loginUser == null) {
        msgs.add("user", new ActionMessage("error.user_not_login"));
        break;
      }
      if(loginUser.getId() != user.getId()){
        msgs.add("user", new ActionMessage("error.access_deny"));
        break;
      }
      UserBean ubean = UserDAO.getUserByID(user.getId());
      if (ubean == null || ubean.getStatus()!=UserBean.STATUS_NORMAL) {
        msgs.add("id", new ActionMessage("error.user_not_available",
            new Integer(user.getId())));
        break;
      }
      if (!StringUtils.equals(ubean.getPassword(), user
          .getPassword())){
        msgs.add("password",
            new ActionMessage("error.user_auth_failed"));
        break;
      }
      if(!StringUtils.equals(user.getQq(), ubean.getQq()) && StringUtils.isNumeric(user.getQq())){
        ubean.setQq(user.getQq());
        try {
          DLOGUserManager.update(ubean);
          //����session�е��û�����
          UserLoginManager.updateLoginUser(request, ubean);   
        } catch (Exception e) {
View Full Code Here

    ActionMessages msgs = new ActionMessages();
    // ��֤�û����ϱ�
    user.validateUserForm(request, msgs, false);
   
    while (msgs.isEmpty()) {
      UserBean loginUser = super.getLoginUser(request, response);
      if(loginUser == null) {
        msgs.add("user", new ActionMessage("error.user_not_login"));
        break;
      }
      if(loginUser.getId() != user.getId()){
        msgs.add("user", new ActionMessage("error.access_deny"));
        break;
      }
      UserBean ubean = UserDAO.getUserByID(user.getId());
      if (ubean == null || ubean.getStatus()!=UserBean.STATUS_NORMAL) {
        msgs.add("id", new ActionMessage("error.user_not_available",
            new Integer(user.getId())));
        break;
      }
      if (!StringUtils.equals(ubean.getPassword(), user
          .getPassword())){
        msgs.add("password",
            new ActionMessage("error.user_auth_failed"));
        break;
      }
      ubean.setNickname(super.autoFiltrate(null, user.getNickname()));
      if(user.getBirth()!=null && user.getBirth().before(new Date()))
        ubean.setBirth(user.getBirth());
      else if(ubean.getBirth()!=null)
        ubean.setBirth(null);
      ubean.setSex(user.getSex());
      if (StringUtils.isNotEmpty(user.getResume()))
        ubean.setResume(super.autoFiltrate(null, StringUtils.extractText(user.getResume())));
      else
        ubean.setResume(null);
      if (!StringUtils.equals(ubean.getPassword(), user.getPassword2())
          && StringUtils.isNotEmpty(user.getPassword2()))
        ubean.setPassword(user.getPassword2());
      if (StringUtils.isNotEmpty(user.getEmail()))
        ubean.setEmail(user.getEmail());
      else
        ubean.setEmail(null);
      if (StringUtils.isNotEmpty(user.getHomePage()))
        ubean.setHomePage(user.getHomePage());
      else
        ubean.setHomePage(null);
      if (StringUtils.isNotEmpty(user.getMobile()))
        ubean.setMobile(user.getMobile());
      else
        ubean.setMobile(null);
      if (StringUtils.isNotEmpty(user.getMsn()))
        ubean.setMsn(user.getMsn());
      else
        ubean.setMsn(null);
      if (StringUtils.isNotEmpty(user.getQq()))
        ubean.setQq(user.getQq());
      else
        ubean.setQq(null);
      if(!StringUtils.equals(ubean.getProvince(), user.getProvince()))
        ubean.setProvince(user.getProvince());
     
      if(!StringUtils.equals(ubean.getCity(), user.getCity()))
        ubean.setCity(user.getCity());
     
      if(user.getRemovePortrait()==1)
        ubean.setPortrait(null);
      else{
        String portrait_uri = handleUserPortrait(ubean.getId(), user.getPortrait());
        if(StringUtils.isNotEmpty(portrait_uri))
          ubean.setPortrait(portrait_uri);
      }
      try {
        DLOGUserManager.update(ubean);
        //����session�е��û�����
        UserLoginManager.updateLoginUser(request, ubean);   
View Full Code Here

TOP

Related Classes of com.liusoft.dlog4j.beans.UserBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.