Examples of UserDao


Examples of org.jresearch.gossip.dao.UserDAO

        }

        // Extract attributes we will need
        HttpSession session = request.getSession();
        ActionErrors errors = new ActionErrors();
        UserDAO userDAO = UserDAO.getInstance();

        FogotPasswordForm fpForm = (FogotPasswordForm) form;

        try {

            User updateduser = userDAO.setNewPassword(fpForm.getEmail(),
                    fpForm.getUid());

            if (updateduser.getStatus() == 0) {
                errors.add(ActionErrors.GLOBAL_ERROR,
                    new ActionError("user.EMERROR"));
View Full Code Here

Examples of org.jresearch.gossip.dao.UserDAO

     * @see org.jresearch.gossip.actions.BaseAction#process(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    protected ActionForward process(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws JGossipException {
        UserDAO dao=UserDAO.getInstance();
        ProcessBanForm pbForm=(ProcessBanForm) form;
        Ban ban=new Ban(Integer.parseInt(pbForm.getType()),pbForm.getMask());
        try {
            dao.addBan(ban);
            BanGuard.getInstance().load();
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
            throw new SystemException(sqle);
        }
View Full Code Here

Examples of org.jresearch.gossip.dao.UserDAO

    /**
     * @throws SystemException
     */
    public void load() throws SystemException {
        UserDAO dao = UserDAO.getInstance();
        try {
            banMap = new BanMap();
            dao.fillBanMap(banMap);
        } catch (SQLException e) {
            throw new SystemException(e);
        }
    }
View Full Code Here

Examples of org.jresearch.gossip.dao.UserDAO

    public ActionForward process(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws SystemException {

        ForumDAO dao = ForumDAO.getInstance();
        UserDAO userdao = UserDAO.getInstance();
        MessageResources messages = getResources(request);
        HttpSession session = request.getSession();

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

        try {
           
            ArrayList groups = dao.getGroups(user.getStatus(), messages);

            for (int i = 0; i < groups.size(); i++) {
                ArrayList forums = ((Group) groups.get(i)).getForums();

                for (int j = 0; j < forums.size(); j++) {
                    Message last = ((Forum) forums.get(j)).getLastMessage();
                    last.setSenderInfo(userdao.getSenderInfo(
                            last.getSender()));
                }
            }

            request.setAttribute(IConst.REQUEST.GROUPS_KEY, groups);
View Full Code Here

Examples of org.jresearch.gossip.dao.UserDAO

     * @return DOCUMENT ME!
     */
    public ActionForward process(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws SystemException {
        UserDAO userdao = UserDAO.getInstance();
        ForumDAO forumdao = ForumDAO.getInstance();
        ProcessUserForm puForm = (ProcessUserForm) form;
        try {

            User userToShow = userdao.getUserInfo(puForm.getUid());
            request.setAttribute(IConst.REQUEST.USER_TO_SHOW, userToShow);

            ArrayList userModForums = forumdao.getUserModForums(userToShow.getName());

            if (userModForums.size() > 0) {
View Full Code Here

Examples of org.jresearch.gossip.dao.UserDAO

        HttpServletRequest request, HttpServletResponse response)
        throws SystemException {
        ProcessForumForm pfForm = (ProcessForumForm) form;

        ForumDAO dao = ForumDAO.getInstance();
        UserDAO userdao = UserDAO.getInstance();
        HttpSession session = request.getSession();

        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        int fid = Integer.parseInt(pfForm.getFid());

        try {
         
            Forum currForum = dao.getForumInfo(fid);

            //check access rights if forum invisible
            if ((currForum.getLocked() == IConst.Forum.STATUS_INVISIBLE) &&
                    (user.getStatus() < Integer.parseInt(
                        Configurator.getInstance().get(IConst.CONFIG.INVADER1)))) {
                return (mapping.findForward(IConst.TOKEN.DENIED));
            }

            request.setAttribute(IConst.REQUEST.CURR_FORUM, currForum);
            session.setAttribute(IConst.SESSION.CURR_FORUM, currForum);

            RecordsData recordsData = new RecordsData();
            dao.fillThreadList(user, recordsData, pfForm);
           

            Iterator it = recordsData.getRecords().iterator();

            while (it.hasNext()) {
                Message mess = ((Topic) it.next()).getLastMessage();
                mess.setSenderInfo(userdao.getSenderInfo(mess.getSender()));
            }

            request.setAttribute(IConst.REQUEST.RECORDS_DATA, recordsData);

            if (dao.checkMod(fid, user)) {
View Full Code Here

Examples of org.jresearch.gossip.dao.UserDAO

            throws SystemException {
        MessageResources messages = getResources(request);
        HttpSession session = request.getSession();
        SendAdminMailForm samForm = (SendAdminMailForm) form;
        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        UserDAO dao = UserDAO.getInstance();
        MessageProcessor mp = MessageProcessor.getInstance();
        String mess = mp.prepareMessage(HtmlCodec.encode(samForm.getText()), 0,
                messages);
        StringBuffer siteUrl = new StringBuffer();
        siteUrl.append(request.getServerName());
        siteUrl.append(":");
        siteUrl.append(request.getServerPort());
        siteUrl.append(request.getContextPath());
        siteUrl.append(Configurator.getInstance().get(
                IConst.CONFIG.MODULE_PREFIX));
        siteUrl.append("/");
        /*
         * {0} - login {1} - message text {2} - site url {3} - site name
         */
        Object[] messArgs = new Object[] { "", mp.nl2br(mess),
                siteUrl.toString(),
                Configurator.getInstance().get(IConst.CONFIG.SITE_NAME) };
        MailQueue queue = (MailQueue) session.getServletContext().getAttribute(
                IConst.CONTEXT.MAIL_QUEUE);
        try {

            ArrayList userMails = dao.getUserEmails();
            Iterator it = userMails.iterator();
            BanGuard guard = BanGuard.getInstance();
            while (it.hasNext()) {
                NamedValue nv = (NamedValue) it.next();

View Full Code Here

Examples of org.jresearch.gossip.dao.UserDAO

        HttpServletRequest request, HttpServletResponse response)
        throws SystemException {
        ListForm lform = (ListForm) form;

        ForumDAO dao = ForumDAO.getInstance();
        UserDAO userdao = UserDAO.getInstance();
        HttpSession session = request.getSession();

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

        try {
           

            RecordsData recordsData = new RecordsData();
            dao.fillLastUpdatedTopicList(user, recordsData, lform.getBlock());
            Iterator it = recordsData.getRecords().iterator();

            while (it.hasNext()) {
                NewTopic nt = (NewTopic) it.next();
                Message mess = nt.getLastMessage();
                mess.setSenderInfo(userdao.getSenderInfo(mess.getSender()));
                nt.setMod_flag(dao.checkMod(nt.getForumid(), user) ? 1 : 0);
            }

            request.setAttribute(IConst.REQUEST.RECORDS_DATA, recordsData);
        } catch (SQLException sqle) {
View Full Code Here

Examples of org.jresearch.gossip.dao.UserDAO

        ActionErrors errors = new ActionErrors();

        String username = logonForm.getUsername();
        String password = logonForm.getPassword();

        UserDAO userDAO = UserDAO.getInstance();

        try {

            user = userDAO.getUser(username, password);
            user.setIp(request.getRemoteAddr());

            if (user.getStatus() == 0) {
                errors.add(ActionErrors.GLOBAL_ERROR,
                    new ActionError("forum.LOG_FAIL",
View Full Code Here

Examples of org.jresearch.gossip.dao.UserDAO

     */
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse res)
            throws Exception {
        HttpSession session = request.getSession();
        UserDAO dao = UserDAO.getInstance();
        String confirmcode = dao.generatePassword();
        session.setAttribute(IConst.SESSION.CONFIRM_CODE, confirmcode);
        res.setContentType(IConst.JSP.JPG_CONTENT_TYPE);
        res.setHeader("Pragma", "no-cache");
        res.setHeader("Cache-Control", "no-cache");
        res.setDateHeader("Expires", 0);
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.