Package org.jresearch.gossip.beans.user

Examples of org.jresearch.gossip.beans.user.User


            HttpServletRequest request, HttpServletResponse response)
            throws SystemException {
        HttpSession session = request.getSession();
        if (null == request.getAttribute("profileForm")) {
            ProfileForm profile = new ProfileForm();
            User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
            profile.setUserInfo(user);
            request.setAttribute("profileForm", profile);
        }
        return (mapping.findForward("showProfile"));
    }
View Full Code Here


     */
    protected ActionForward process(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws JGossipException {
        HttpSession session = request.getSession();
        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        ForumDAO dao = ForumDAO.getInstance();
        ProcessAttachForm paForm = (ProcessAttachForm) form;
       
        try {
            boolean isUserMod = dao.checkMod(Integer.parseInt(paForm.getFid()),
View Full Code Here

      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    HttpSession session = request.getSession();
    MessageForm messageForm = new MessageForm();
    ForumDAO dao = ForumDAO.getInstance();
    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    ProcessMessageForm pmForm = (ProcessMessageForm) form;
    try {
     
      int fid = Integer.parseInt(pmForm.getFid());
      boolean isUserMod = dao.checkMod(fid, user);
      Topic currThread = dao.getThreadInfo(Integer.parseInt(pmForm
          .getTid()));
      Message mess = dao.getMessage(pmForm.getMid());
      if (mess == null) {
        return (new ActionForward("/ShowThread.do?fid="
            + pmForm.getFid() + "&tid=" + pmForm.getTid()
            + "&block=" + pmForm.getBlock(), true));
      } else {
        // check user access rights
        getServlet().log("check user access rights ");
        if (isUserMod
            || (user.getName().equals(mess.getSender()) && (currThread
                .getLocked() == IConst.Topic.STATUS_UNLOCKED))) {
          return super.process(mapping, form, request, response);
        } else {
          return (mapping.findForward(IConst.TOKEN.DENIED));
        }
View Full Code Here

    public ActionForward process(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws SystemException {
        HttpSession session = request.getSession();

        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);

        ListForm lform = (ListForm) form;
        UserDAO userdao = UserDAO.getInstance();

        try {
View Full Code Here

        eval();

        try {
            HttpSession session = pageContext.getSession();
            HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
            User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
            Topic t = (Topic) pageContext.getAttribute(threadBean);
            int total = (int) t.getMessagesCount();

            if (total > user.getSettings().getMes_per_page()) {
                StringBuffer links = new StringBuffer("(");

                int rep = (int) Math.floor(total / user.getSettings()
                                                       .getMes_per_page()) + 1;
                int i = 1;

                while ((i <= rep) &&
                        (((i - 1) * user.getSettings().getMes_per_page()) < total)) {
                    StringBuffer href = new StringBuffer();
                    links.append("<a href=\"");
                    href.append("ShowThread.do?fid=");
                    href.append(forumId);
                    href.append("&tid=");
                    href.append(t.getThreadid());
                    href.append("&block=");
                    href.append((i - 1) * user.getSettings().getMes_per_page());
                    links.append(response.encodeURL(href.toString()));
                    links.append("\" class=\"thread_name\" >");
                    links.append(i);
                    links.append("</a>");

View Full Code Here

     */
    public int doStartTag() throws JspException {
        eval();

        try {
            User user = (User) pageContext.getSession().getAttribute(IConst.SESSION.USER_KEY);

            Date lastvisit = null;
            HashMap visited = (HashMap) pageContext.getSession().getAttribute(IConst.SESSION.LAST_INTIME);

            if ((!visited.isEmpty()) && visited.containsKey(tid)) {
                lastvisit = (Date) visited.get(tid);
            } else {
                lastvisit = user.getIntime();
            }

            String username = (user.getName() != null) ? user.getName() : " ";

            if (lastvisit.before(getIntime()) && (!username.equals(sender))) {
                pageContext.setAttribute(IConst.PAGE.HAVE_AN_UPDATED_TOPICS,
                    IConst.VALUES.TRUE);

View Full Code Here

  }

  final public void testFillLogEntryList() throws Exception
  {
    RecordsData records = new RecordsData();
    User user = null;
    records.setBlockSize((null != user)?user.getSettings().getMes_per_page():25);
    LogSearchCriteria criteria = new LogSearchCriteria();
    criteria.setFrom(from);
    criteria.setTo(to);
    criteria.setLog_level(IConst.VALUES.ALL);
    criteria.setLogger(IConst.VALUES.ALL);
View Full Code Here

  }

  final public void testFillLogEntryListWARN() throws Exception
  {
    RecordsData records = new RecordsData();
    User user = null;
    records.setBlockSize((null != user)?user.getSettings().getMes_per_page():25);
    LogSearchCriteria criteria = new LogSearchCriteria();
    criteria.setFrom(from);
    criteria.setTo(to);
    criteria.setLog_level("WARN");
    criteria.setLogger(IConst.VALUES.ALL);
View Full Code Here

  }

  final public void testFillLogEntryListINFO() throws Exception
  {
    RecordsData records = new RecordsData();
    User user = null;
    records.setBlockSize((null != user)?user.getSettings().getMes_per_page():25);
    LogSearchCriteria criteria = new LogSearchCriteria();
    criteria.setFrom(from);
    criteria.setTo(to);
    criteria.setLog_level("INFO");
    criteria.setLogger("FORUM");
View Full Code Here

     * (non-Javadoc)
     *
     * @see javax.servlet.http.HttpSessionAttributeListener#attributeAdded(javax.servlet.http.HttpSessionBindingEvent)
     */
    private Entry getCurrentEntry(HttpSessionBindingEvent evt) {
        User user = (User) evt.getSession().getAttribute(
                IConst.SESSION.USER_KEY);
        Entry entry = new Entry(user.getName(), evt.getSession().getId(), user
                .getIp());

        return entry;
    }
View Full Code Here

TOP

Related Classes of org.jresearch.gossip.beans.user.User

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.