Package elicitation.model.user

Examples of elicitation.model.user.SysUser


  public static int VALIDATE_FAIL = -2 ;
  public static int VALIDATE_OK  =  0 ;
  public static int login(String username, String passwd) throws Exception
  {
    SqlMapClient client = Utils.getMapClient();
    SysUser user = null;   
    user = (SysUser)client.queryForObject("user.getUserByUserName", username);   
    if(user == null) return LOGIN_ERROR;   
    if(user.getPassword().equals(passwd))
    {
      ActionContext.getContext().getSession().put("user", user);
      return user.getUserId().intValue();
    }
    else return LOGIN_ERROR;
  }
View Full Code Here


    }
    else return LOGIN_ERROR;
  }
  public static int validateName(String username)throws Exception{
    SqlMapClient client = Utils.getMapClient();
    SysUser user = null;
    user = (SysUser)client.queryForObject("user.getUserByUserName",username);
    if(user != null) return VALIDATE_FAIL;
    return VALIDATE_OK;
  }
View Full Code Here

  public static String register(String userName, String passwd, String email) throws Exception
  {
   
      client = Utils.getMapClient();
      SysUser user = null;
     
      user = (SysUser)client.queryForObject("user.getUserByUserName", userName);   
      // 在jsp中,利用Ajax做了用户名验证了.
      if(user==null)
      {
        user = new SysUser();
        user.setUserName(userName);
        user.setPassword(passwd);
        user.setEmail(email);
       
        // String activeCode = activeCode();
        // user.setActiveCode(activeCode);
        //user.setActive(false);
        Object key = client.insert("user.registerUser", user);
View Full Code Here

TOP

Related Classes of elicitation.model.user.SysUser

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.