Package org.jresearch.gossip.dao

Examples of org.jresearch.gossip.dao.UserDAO


                || IConst.VALUES.FALSE.equals(Configurator.getInstance().get(
                        IConst.CONFIG.ENABLE_EMAIL_CONFIRMATION))) { return (mapping
                .findForward(IConst.TOKEN.DENIED)); }

        HttpSession session = request.getSession();
        UserDAO dao = UserDAO.getInstance();
        PendingRegistrationForm pprForm = (PendingRegistrationForm) form;
        try {
           

            if (dao.checkPendingUser(pprForm.getLogin(), pprForm.getCode())) {
                dao.deletePendingUser(pprForm.getLogin());
            }
            setStatusMessage(request, "status.PENDING_REGISTRATION_CANCELLED",
                    pprForm.getLogin());
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
View Full Code Here


        }

        application.log("AutoLoginFilter: external user login=" + extUserLogin);

        if (extUserLogin != null) {
            UserDAO dao = UserDAO.getInstance();

            try {

                if (!dao.isUserExist(extUserLogin)) {
                    //create empty user with status=1 and name=extUserLogin
                    user = new User(request.getRemoteAddr());
                    user.setName(extUserLogin);
                    user.setStatus(UserStatus.USER);
                } else {
                    user = dao.getUser(extUserLogin);
                    user.setIp(request.getRemoteAddr());
                }

                application
                        .log("AutoLoginFilter: external user is loaded with login="
View Full Code Here

        User user = null;

        if ((userCookie != null)) {
            HttpSession session = request.getSession();
            ServletContext application = session.getServletContext();
            UserDAO dao = UserDAO.getInstance();
            StringTokenizer login = new StringTokenizer(userCookie, "*");

            if (login.countTokens() >= 2) {
                try {
                    user = dao.getUserEncoded(login.nextToken(), login
                            .nextToken());
                } catch (SQLException sqle) {
                    throw new ServletException(sqle);
                }
            }
View Full Code Here

        throws SystemException {
        HttpSession session = request.getSession();
        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        ForumDAO dao = ForumDAO.getInstance();
        RecordsData recordsData = new RecordsData();
        UserDAO userdao = UserDAO.getInstance();

        try {
            dao.processSearch((SearchForm) form, recordsData,
                user.getStatus() > 7);

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

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

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

                || IConst.VALUES.TRUE.equals(Configurator.getInstance().get(
                        IConst.CONFIG.ENABLE_EMAIL_CONFIRMATION))) { return (mapping
                .findForward(IConst.TOKEN.DENIED)); }

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

        try {
           

            if (dao.addUser((ProfileForm) form)) {
                User user = dao.getUser(((ProfileForm) form).getLogin(),
                        ((ProfileForm) form).getPassword());
                log(request, "logs.LOG7", user.getName());

                if (user.getStatus() > 0) {
                    user.setIp(request.getRemoteAddr());
View Full Code Here

        if (IConst.VALUES.FALSE.equals(Configurator.getInstance().get(
                IConst.CONFIG.ENABLE_FORUM_SIGN_ON))) { return (mapping
                .findForward(IConst.TOKEN.DENIED)); }

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

        try {

            ProfileForm pf = (ProfileForm) form;
            String tempPass = dao.generatePassword();
            pf.setPassword(tempPass);
            pf.setPassword2(tempPass);

            if (dao.addUser(pf)) {
                User newuser = dao.getUser(pf.getLogin(), pf.getPassword());
                log(request, "logs.LOG29", newuser.getName());
                setStatusMessage(request, "status.USER_ADDED", newuser
                        .getName());

                /*
 
View Full Code Here

        HttpSession session = request.getSession();

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

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

        try {
            RecordsData recordsData = new RecordsData();
            userdao.fillUserList(user, recordsData, lform);          
            request.setAttribute(IConst.REQUEST.RECORDS_DATA, recordsData);
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
            throw new SystemException(sqle);
        } catch (Exception e) {
View Full Code Here

     * @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.deleteBan(ban);
            BanGuard.getInstance().load();
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
            throw new SystemException(sqle);
        }
View Full Code Here

        //Setting Up Datasource
        try {
            ds = setupDataSource();
            ForumDAO dao = ForumDAO.getInstance();
            dao.setDataSource(ds);
            UserDAO udao = UserDAO.getInstance();
            udao.setDataSource(ds);
        } catch (IOException e) {
            throw new ServletException(e);
        } catch (Exception e) {
            throw new ServletException(e);
        }
View Full Code Here

            ServletContext app = session.getServletContext();

            User user = (User) evt.getValue();

            UserDAO dao = UserDAO.getInstance();
            ForumDAO forumdao = ForumDAO.getInstance();

            try {
                forumdao.removeEntry(session.getId());

                if (user.getStatus() != UserStatus.GUEST) {
                    dao.updateIntime(user.getName());
                }
                //              write message in forum log
                JGossipLog.audit(LogLevel.INFO, user, ((MessageResources) app
                        .getAttribute(Globals.MESSAGES_KEY
                                + Configurator.getInstance().get(
View Full Code Here

TOP

Related Classes of org.jresearch.gossip.dao.UserDAO

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.