Examples of UserForm


Examples of at.riemers.zero.base.user.controller.edituser.UserForm

            HttpSession session,
            HttpServletRequest request) throws Exception {

        ZeroView view = new ZeroView(getMessages(), request.getLocale());

        UserForm userForm = new UserForm();

        ZeroUser user = (ZeroUser) getUser();

        userForm.setEmail(user.getPerson().getEmail());
        userForm.setFirstname(user.getPerson().getFirstname());
        userForm.setLastname(user.getPerson().getLastname());
        userForm.setPhone(user.getPerson().getPhone());
        //userForm.setLanguage(user.getLanguage());

        view.getJson().element("parameters", UserJSONizer.createParameters(getModuleManager(), (ZeroUser) user, true));

        view.getJson().element("form", userForm);
View Full Code Here

Examples of com.insacosa.vo.UserForm

    inmoble.setPuerta(inmobleForm.getPuerta());
    inmoble.setMetres(inmobleForm.getMetres());
    inmoble.setPreu(inmobleForm.getPreu());
 
    facesContext = FacesContext.getCurrentInstance(); // Contexte JSF
    UserForm userForm = (UserForm) facesContext.getApplication().evaluateExpressionGet(facesContext, "#{userForm}", UserForm.class);
    Usuaris venedor = new Usuaris();
   
 
    venedor.setUsuariKey(userForm.getGuid());
    //inmoble.setUsuaris(venedor);

   
    // **********************
    // COLECCIONS
View Full Code Here

Examples of com.jpoweredcart.admin.form.user.UserForm

   
    UserPermissions.checkModify("user/user",
        new UnauthorizedAdminException());
    initUserForm(model);
   
    model.addAttribute("userForm", new UserForm());
   
    return "/admin/user/userForm";
  }
View Full Code Here

Examples of com.liusoft.dlog4j.formbean.UserForm

   * @throws Exception
   */
  protected ActionForward doFetchPwd(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    UserForm uform = (UserForm) form;
    validateClientId(request, uform);
    ActionMessages msgs = new ActionMessages();
    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) {
View Full Code Here

Examples of com.liusoft.dlog4j.formbean.UserForm

   * @ajax_enabled
   */
  protected ActionForward doBlockUser(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    UserForm fbean = (UserForm)form;
    super.validateClientId(request, fbean);
    String msg = null;
    //�ж��û��Ƿ��¼
    SessionUserObject loginUser = super.getLoginUser(request, response, false);
    if(loginUser!=null){
      String s_id = String.valueOf(fbean.getId());
      if(UserDAO.isUserInBlackList(loginUser.getId(), fbean.getId())){
        msg = getMessage(request,null,"error.user_already_in_block", s_id);
      }
      else{
        UserDAO.addBlackList(loginUser.getId(), fbean.getId(), 0);
        msg = getMessage(request,null,"error.user_added_to_block", s_id);
      }
    }
    else
      msg = getMessage(request,null,"error.user_not_login");
    request.setAttribute("msg", msg);
    return makeForward(mapping.findForward("blacklist"),fbean.getSid());
  }
View Full Code Here

Examples of com.liusoft.dlog4j.formbean.UserForm

   */
  protected ActionForward doLogin(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    int own_site_id = -1;
    UserForm user = (UserForm) form;
    validateClientId(request, user);
    ActionMessages msgs = new ActionMessages();
    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);
      return mapping.findForward("login");
    }
   
    String fromPage = user.getFromPage();
   
    if (StringUtils.isNotEmpty(fromPage))
      return new ActionForward(fromPage, true);
   
    if(user.getSid()>0)
      return makeForward(mapping.findForward("main"), user.getSid());
   
    if(own_site_id < 1)
      return mapping.findForward("home");

    return makeForward(mapping.findForward("home"), own_site_id);
View Full Code Here

Examples of com.liusoft.dlog4j.formbean.UserForm

   * @wml_only modify_birth.vm
   */
  protected ActionForward doUpdateBirth(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    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 {
          DLOGUserManager.update(ubean);
          //����session�е��û�����
          UserLoginManager.updateLoginUser(request, ubean);   
        } catch (Exception e) {
          msgs.add("result", new ActionMessage("error.database", e
              .getMessage()));
        }
      }     
      break;
    }

    if (!msgs.isEmpty()) {
      saveMessages(request, msgs);
      return mapping.findForward("edituser");
    }

    StringBuffer ext = new StringBuffer();
    ext.append("uid=");
    ext.append(user.getId());
    return makeForward(mapping.findForward("viewuser"), user.getSid(), ext.toString());
  }
View Full Code Here

Examples of com.liusoft.dlog4j.formbean.UserForm

   * @wml_only modify_email.vm
   */
  protected ActionForward doUpdateEmail(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    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) {
        msgs.add("result", new ActionMessage("error.database", e
            .getMessage()));
      }
      break;
    }

    if (!msgs.isEmpty()) {
      saveMessages(request, msgs);
      return mapping.findForward("edituser");
    }

    StringBuffer ext = new StringBuffer();
    ext.append("uid=");
    ext.append(user.getId());
    return makeForward(mapping.findForward("viewuser"), user.getSid(), ext.toString());
  }
View Full Code Here

Examples of com.liusoft.dlog4j.formbean.UserForm

   * @wml_only modify_sex.vm
   */
  protected ActionForward doUpdateSex(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    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) {
            msgs.add("result", new ActionMessage("error.database",
                e.getMessage()));
          }
        }
      }
      break;
    }

    if (!msgs.isEmpty()) {
      saveMessages(request, msgs);
      return mapping.findForward("edituser");
    }

    StringBuffer ext = new StringBuffer();
    ext.append("uid=");
    ext.append(user.getId());
    return makeForward(mapping.findForward("viewuser"), user.getSid(), ext.toString());
  }
View Full Code Here

Examples of com.liusoft.dlog4j.formbean.UserForm

   * @wml_only modify_pwd.vm
   */
  protected ActionForward doUpdatePwd(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    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) {
          msgs.add("result", new ActionMessage("error.database", e
              .getMessage()));
        }
      }
      break;
    }

    if (!msgs.isEmpty()) {
      saveMessages(request, msgs);
      return mapping.findForward("edituser");
    }

    StringBuffer ext = new StringBuffer();
    ext.append("uid=");
    ext.append(user.getId());
    return makeForward(mapping.findForward("viewuser"), user.getSid(), ext.toString());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.