Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.UserBean


                .getAlbum())));
        break;
      }

      SiteBean site = super.getSiteBean(request);
      UserBean loginUser = super.getLoginUserAfterValidateSiteOwner(request);

      String photo_desc;
      if(StringUtils.isNotEmpty(photo1.getDesc())){
        photo_desc = StringUtils.abbreviate(super.autoFiltrate(
            site, photo1.getDesc()), MAX_PHOTO_DESC_LENGTH);
View Full Code Here


      HttpServletResponse response) throws Exception {
    ReplyForm reply = (ReplyForm) form;
    //��֤�ͻ��˰�ȫʶ����
    validateClientId(request, reply);
    ActionMessages msgs = new ActionMessages();
    UserBean loginUser = super.getLoginUser(request, response);
    while (loginUser != null) {
      if (StringUtils.isEmpty(reply.getContent())) {
        msgs.add("reply", new ActionMessage("error.empty_not_allowed"));
        break;
      }
View Full Code Here

      HttpServletResponse response) throws Exception {
    ReplyForm reply = (ReplyForm) form;
    //��֤�ͻ��˰�ȫʶ����
    validateClientId(request, reply);
    ActionMessages msgs = new ActionMessages();
    UserBean loginUser = super.getLoginUser(request, response);
    while (loginUser != null) {
      if (StringUtils.isEmpty(reply.getContent())) {
        msgs.add("reply", new ActionMessage("error.empty_not_allowed"));
        break;
      }
View Full Code Here

      ActionForm form, HttpServletRequest request,
      HttpServletResponse response, String s_reply_id) throws Exception {
    String msg = null;
    ReplyForm reply = (ReplyForm) form;
    int reply_id = Integer.parseInt(s_reply_id);
    UserBean loginUser = super.getLoginUser(request, response);
    while (loginUser != null) {
      SiteBean site = super.getSiteByID(reply.getSid());
      if (site == null) {
        msg = getMessage(request, null, "error.site_not_available");
        break;
      }
      PhotoReplyBean rbean = (PhotoReplyBean) ReplyDAO.getReply(
          PhotoReplyBean.class, reply_id);
      if (rbean == null)
        break;
      if (rbean.getSite().getId() != reply.getSid()) {
        msg = getMessage(request, null, "error.param");
        break;
      }
      if (!site.isOwner(loginUser)
          && !isReplyBelongToUser(rbean, loginUser.getId())) {
        msg = getMessage(request, null, "error.access_deny");
        break;
      }
      PhotoDAO.deletePhotoReply(rbean);
      break;
View Full Code Here

      ActionForm form, HttpServletRequest request,
      HttpServletResponse response, String s_reply_id) throws Exception {
    String msg = null;
    ReplyForm reply = (ReplyForm) form;
    int reply_id = Integer.parseInt(s_reply_id);
    UserBean loginUser = super.getLoginUser(request, response);
    while (loginUser != null) {
      SiteBean site = super.getSiteByID(reply.getSid());
      if (site == null) {
        msg = getMessage(request, null, "error.site_not_available");
        break;
      }
      DiaryReplyBean rbean = (DiaryReplyBean) ReplyDAO.getReply(
          DiaryReplyBean.class, reply_id);
      if (rbean == null)
        break;
      if (rbean.getSite().getId() != reply.getSid()) {
        msg = getMessage(request, null, "error.param");
        break;
      }
      if (!site.isOwner(loginUser)
          && !isReplyBelongToUser(rbean, loginUser.getId())) {
        msg = getMessage(request, null, "error.access_deny");
        break;
      }
      DiaryDAO.deleteDiaryReply(rbean);
      break;
View Full Code Here

      }
      if(reply.getContent().getBytes().length >= 3000){
        msgs.add("reply", new ActionMessage("error.reply_too_long"));
        break;
      }
      UserBean loginUser = super.getLoginUser(request, response);
      SiteBean site = super.getSiteByID(reply.getSid());
      if (site == null) {
        msgs.add("reply", new ActionMessage("error.site_not_available"));
        break;
      }
View Full Code Here

      SiteBean site = super.getSiteByID(reply.getSid());
      if (site == null) {
        msgs.add("reply", new ActionMessage("error.site_not_available"));
        break;
      }
      UserBean loginUser = super.getLoginUser(request, response);
      //��������
      if(loginUser!=null && isUserInBlackList(site, loginUser)){
        msgs.add("photo", new ActionMessage("error.user_in_blacklist"));
        break;
      }
View Full Code Here

   * @throws Exception
   */
  public SiteBean auto_create_site() throws Exception{
    String username = "admin";
    //�����û�
    UserBean ubean = auto_create_user(username);
    //������վ
    SiteBean sbean = auto_create_site(ubean);
    //ִ�е�¼����
    UserLoginManager.loginUser(request, response, ubean, -1);
    return sbean;
View Full Code Here

   * �Զ�����dlog�û�
   * @param username
   * @return
   */
  private UserBean auto_create_user(String username){
    UserBean ubean = new UserBean();
    ubean.setName(username);
    String nickname = null;
      MessageResources res = StrutsUtils.getMessageResources(request, context, null);
      if(res!=null)
        nickname = res.getMessage("administrator");
      if(StringUtils.isEmpty(nickname))
        nickname = "Administrator";
    ubean.setNickname(nickname);
    ubean.setPassword("admin");   
    UserDAO.createUser(ubean);
    return ubean;
  }
View Full Code Here

    try {
      UUID oUUID = new UUID(uuid);
      String new_host = request.getRemoteAddr();
      if (verify_host && !StringUtils.equals(new_host, oUUID.host))
        return null;
      UserBean user = UserDAO.getUserByID(oUUID.uid);
      // �û�������
      if (user == null || user.getStatus() != UserBean.STATUS_NORMAL
          || user.getPassword().hashCode() != oUUID.pwdCode) {
        RequestUtils.setCookie(request, response, COOKIE_UUID_KEY, "", 0);
        RequestUtils.setCookie(request, response, COOKIE_LASTLOGIN_KEY, "", 0);
        return null;
      }
      int keep_days = user.getKeepDays();
      if(keep_days < 1) keep_days = 365;
      return loginUser(request, response, user, keep_days);
    } catch (Exception e) {
      log.error("Exception occur when get current user.", 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.