Package com.sogou.qadev.service.cynthia.bean

Examples of com.sogou.qadev.service.cynthia.bean.UserInfo


        current_userNode.setTextContent( username );
        envNode.appendChild( current_userNode );
      }
     
      //   拼进当前执行人的相关人员列表
      UserInfo userInfo = das.queryUserInfoByUserName(username);
      if (userInfo != null) {
        Element userElement = document.createElement( "user_list" );
        userElement.setTextContent( userInfo.getUserName() );
        envNode.appendChild( userElement );
      }
     
      List<Node> typeNodeList = XMLUtil.getNodes( document, "/query/env/current_template_type");
      if( typeNodeList != null && !typeNodeList.isEmpty() )
View Full Code Here


    //用户邮箱己存在
    if (das.queryUserInfoByUserName(userMail) != null) {
      return String.valueOf(false);
    }
   
    UserInfo userInfo = new UserInfo();
    userInfo.setCreateTime(new Timestamp(System.currentTimeMillis()));
    userInfo.setNickName(userAlias);
    userInfo.setUserName(userMail);
    userInfo.setUserPassword(userPassword);
    userInfo.setUserRole(UserRole.normal);
    userInfo.setUserStat(UserStat.not_auth);
    boolean isSuccess = das.addUserInfo(userInfo);
    return String.valueOf(isSuccess);
  }
View Full Code Here

  public String changeStat(HttpServletRequest request, HttpServletResponse response ,HttpSession session) throws Exception {
    String userMail = request.getParameter("user");
    if (userMail == null || userMail.length() == 0) {
      return "false";
    }
    UserInfo userInfo = das.queryUserInfoByUserName(userMail);
    if (userInfo == null) {
      return "false";
    }
    UserStat userStat = null;
    try {
      userStat = UserStat.valueOf(request.getParameter("status"));
    } catch (Exception e) {
      e.printStackTrace();
    }
    if (userStat == null) {
      return "false";
    }
    userInfo.setUserStat(userStat);
    return String.valueOf(das.updateUserInfo(userInfo));
  }
View Full Code Here

  public String getUserInfo(HttpServletRequest request, HttpServletResponse response ,HttpSession session) throws Exception {
    String userMail = request.getParameter("user");
    if (userMail == null || userMail.length() == 0) {
      return "false";
    }
    UserInfo userInfo = das.queryUserInfoByUserName(userMail);
    if (userInfo == null) {
      return "false";
    }
   
    return JSONArray.toJSONString(userInfo);
View Full Code Here

  public String updateUserInfo(HttpServletRequest request, HttpServletResponse response ,HttpSession session) throws Exception {
    String userMail = request.getParameter("user");
    if (userMail == null || userMail.length() == 0) {
      return "false";
    }
    UserInfo userInfo = das.queryUserInfoByUserName(userMail);

    String picId = request.getParameter("picId");
    if (picId != null && !picId.equals("")) {
      userInfo.setPicId(picId);
    }
   
    String nickName = request.getParameter("nickName");
    if (nickName != null && !nickName.equals("")) {
      userInfo.setNickName(nickName);
    }
   
    String nowPass = request.getParameter("nowPass");
    String changePass = request.getParameter("changePass");
    if (nowPass != null && !nowPass.equals("") && changePass != null && !changePass.equals("")) {
      if (!nowPass.equals(userInfo.getUserPassword())) {
        return "当前密码错误!";
      }else {
        userInfo.setUserPassword(changePass);
      }
    }
   
    return String.valueOf(das.updateUserInfo(userInfo));
  }
View Full Code Here

            CookieManager.addCookie(response , "remember" , remember , loginMaxAge);
      }else {
        loginMaxAge = 24*60*60;   //不自动登陆则为一天
      }
         
          UserInfo userInfo = das.queryUserInfoByUserName(userName);
         
          CookieManager.addCookie(response , "login_username" , userName , loginMaxAge);
        CookieManager.addCookie(response , "login_password" , password , loginMaxAge);  
        CookieManager.addCookie(response , "login_nickname" , URLEncoder.encode(userInfo.getNickName(), "UTF-8") , loginMaxAge);  
       
        session.setAttribute("userName",userName);
       
      if(userInfo != null//中文名
        session.setAttribute("userAlis", userInfo.getNickName());
     
      //更新最后登陆时间
      userInfo.setLastLoginTime(new Timestamp(System.currentTimeMillis()));
      das.updateUserInfo(userInfo);
     
        if (targetUrl != null && !targetUrl.equals("")) {
          return targetUrl;   //跳转到目标页
      }else {
View Full Code Here

   * @param session
   * @return
   */
  public boolean validate(String userName,String password,HttpSession session)
  {
    UserInfo userInfo = das.queryUserInfoByUserName(userName);
    if (userInfo == null) {
      session.setAttribute("loginErrorInfo","用户名不存在!");
      return false;
    }
    if (userInfo.getUserPassword() != null && !userInfo.getUserPassword().equals(password)) {
      session.setAttribute("loginErrorInfo","密码错误!");
      return false;
    }
    if (userInfo.getUserStat().equals(UserStat.not_auth)) {
      session.setAttribute("loginErrorInfo","帐号目前未通过管理员审核!");
      return false;
    }else if (userInfo.getUserStat().equals(UserStat.lock)) {
      session.setAttribute("loginErrorInfo","帐号目前己被锁定,请与管理员联系!");
      return false;
    }
    return true;
  }
View Full Code Here

          tempKey.setUsername(userName);
          session.setAttribute("userName", userName);
          session.setAttribute("key", tempKey);
      }
     
      UserInfo userInfo = das.queryUserInfoByUserName(userName);
      if (userName == null || userInfo == null) {
        //跳转到登陆界面

        String requestUrl = httpRequest.getRequestURL().toString();
        String queryString = httpRequest.getQueryString();
View Full Code Here

    if (userName == null)
      return false;
    if (eventId == 1)
      return true;
    //判断是否具有后台权限
    UserInfo userInfo = das.queryUserInfoByUserName(userName);
   
    if (userInfo == null) {
      return false;
    }else {
      //状态正常 并且为管理员或超级管理员具有后台权限
      return userInfo.getUserStat().equals(UserStat.normal) &&
          (userInfo.getUserRole().equals(UserRole.admin) ||
              userInfo.getUserRole().equals(UserRole.super_admin));
    }
  }
View Full Code Here

           Node envNode = XMLUtil.getSingleNode(filterDoc, "query/env");

           XMLUtil.getSingleNode(envNode, "current_user").setTextContent(key.getUsername());

           UserInfo userInfo = das.queryUserInfoByUserName(key.getUsername());
           if (userInfo != null) {
             Node userListNode = filterDoc.createElement("user_list");
             userListNode.setTextContent(userInfo.getUserName());
             envNode.appendChild(userListNode);
        }

           filter.setXml(XMLUtil.document2String(filterDoc, "UTF-8"));
         }
View Full Code Here

TOP

Related Classes of com.sogou.qadev.service.cynthia.bean.UserInfo

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.