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(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


    do{
      if(StringUtils.isEmpty(uform.getName())){
        msgs.add("name", new ActionMessage("error.username_empty"));
        break;
      }
      UserBean ubean = UserDAO.getUserByName(uform.getName());
      if(ubean==null){
        msgs.add("name", new ActionMessage("error.user_not_found"));
        break;
      }
      if (ubean.getStatus() != UserBean.STATUS_NORMAL) {
        msgs.add("name", new ActionMessage("error.user_disabled"));
        break;
      }
      if(!StringUtils.isEmail(ubean.getEmail())){
        msgs.add("name", new ActionMessage("error.email_format"));
        break;
      }
      //�����ʼ�
      int siteid = (ubean.getSite()!=null)?ubean.getSite().getId():-1;
      sendPasswordNotify(request, siteid, ubean);
      msgs.add("name", new ActionMessage("mail.sent"));
      break;
    }while(true);
     
View Full Code Here

    String msg = null;
    //�ж��û��Ƿ��¼
    SessionUserObject loginUser = super.getLoginUser(request, response, false);
    if(loginUser != null){
      int friendId = RequestUtils.getParam(request, "uid", -1);
      UserBean friend = UserDAO.getUserByID(friendId);
      if(friend==null)
        msg = getMessage(request,null,"error.user_not_found", new Integer(friendId));
      else if(friendId == loginUser.getId())
        msg = getMessage(request,null,"error.cannot_add_myself");
      else{
View Full Code Here

    if (StringUtils.isEmpty(user.getName()))
      msgs.add("username", new ActionMessage("error.username_empty"));
    else if (StringUtils.isEmpty(user.getPassword()))
      msgs.add("password", new ActionMessage("error.password_empty"));
    else {
      UserBean ubean = DLOGUserManager.getUserByName(user.getName());
      if (ubean == null
          || !StringUtils.equals(ubean.getPassword(), user
              .getPassword()))
        msgs.add("password",
            new ActionMessage("error.user_auth_failed"));
      else if (ubean.getStatus() != UserBean.STATUS_NORMAL) {
        msgs.add("password", new ActionMessage("error.user_disabled"));
      } else {
        // ִ�е�¼����
        UserLoginManager.loginUser(request, response, ubean, user.getKeepDays());
        own_site_id = ubean.getOwnSiteId();
      }
    }

    if (!msgs.isEmpty()) {
      saveMessages(request, msgs);
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;
      }
      boolean update = false;
      if(StringUtils.isNotEmpty(user.getSbirth())){
        try{
          int birth = Integer.parseInt(user.getSbirth());
          int year = birth / 10000;
          int month = (birth % 10000) / 100;
          int date = birth % 100;
          long lbirth = DateUtils.getDateBegin(year,month,date).getTime().getTime();
          ubean.setBirth(new java.sql.Date(lbirth));
          System.out.println("=================  new birth is " + ubean.getBirth());
          update = true;
        }catch(Exception e){}
      }
      if(update){
        try {
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;
      }
      ubean.setEmail(user.getEmail());
      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 (ubean.getSex() != user.getSex()) {
        if (user.getSex() == UserBean.SEX_FEMALE
            || user.getSex() == UserBean.SEX_MALE
            || user.getSex() == UserBean.SEX_UNKNOWN) {
          ubean.setSex(user.getSex());
          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.getPassword2(), ubean.getPassword())){
        ubean.setPassword(user.getPassword2());
        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.getResume(), ubean.getResume())){
        String resume = super.autoFiltrate(null, StringUtils.extractText(user.getResume()));
        ubean.setResume(resume);
        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.getMsn(), ubean.getMsn())){
        ubean.setMsn(user.getMsn());
        try {
          DLOGUserManager.update(ubean);
          //����session�е��û�����
          UserLoginManager.updateLoginUser(request, ubean);   
        } catch (Exception e) {
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.