Package org.jresearch.gossip.dao

Examples of org.jresearch.gossip.dao.UserDAO


    public ActionForward process(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws SystemException {
        MessageResources messages = getResources(request);
        ForumDAO dao = ForumDAO.getInstance();
        UserDAO userdao = UserDAO.getInstance();
    Configurator config=Configurator.getInstance();
    ProcessModForm pmForm = (ProcessModForm) form;

        try {

            dao.dropMod(pmForm.getFid(),pmForm.getName());

            int newStatus = 0;

            if (dao.isUserMod(pmForm.getName())) {
                newStatus = UserStatus.MOD;
            } else {
                newStatus = UserStatus.USER;
            }

            userdao.setUserStatus(pmForm.getName(),
                newStatus);
            log(request, "logs.LOG10",
                newStatus + " name=" +
        pmForm.getName());
View Full Code Here


        }

        HttpSession session = request.getSession();

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

        try {
           

            if (MD5Digest.digest( user.getName(),
                        ((ChangePasswordForm) form).getPassword()
                       )
                       .equals(user.getPassword())) {
                dao.changePassword(((ChangePasswordForm) form).getPassword1(),
                    user.getName());
                log(request, "logs.LOG8");
                user = dao.getUser(user.getName(),
                        ((ChangePasswordForm) form).getPassword1());

                if (IConst.VALUES.TRUE.equals(Configurator.getInstance().get(IConst.CONFIG.ENABLE_AUTO_LOGIN))) {
                    //            set autolog cookies if needed...
                    if (user.getSettings().isAutologin()) {
View Full Code Here

     * @return DOCUMENT ME!
     */
    public ActionForward process(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws SystemException {
        UserDAO dao = UserDAO.getInstance();
        ProcessUserStatusForm pusForm = (ProcessUserStatusForm) form;
        try {
           

            User u = dao.getUserInfoShort(Integer.parseInt(pusForm.getId()));
            dao.setUserStatus(u.getName(), Integer
                    .parseInt(pusForm.getStatus()));
            log(request, "logs.LOG10", pusForm.getStatus() + " uid="
                    + u.getName());

            setUpdatedLogin(dao.getUserName(Integer.parseInt(pusForm.getId())));
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
            throw new SystemException(sqle);
        }

View Full Code Here

                || 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 {
           

            ProfileForm profile = new ProfileForm();
            profile.setLogin(pprForm.getLogin());
            profile.setEmail(pprForm.getEmail());
            String password = dao.generatePassword();
            profile.setPassword(password);
            profile.setPassword2(password);

            if (dao.checkPendingUser(pprForm.getLogin(), pprForm.getCode())
                    && dao.addUser(profile)) {
                dao.deletePendingUser(pprForm.getLogin());
                User newuser = dao.getUser(profile.getLogin(), profile
                        .getPassword());
                log(request, "logs.LOG7", newuser.getName());

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

        HttpSession session = request.getSession();
        MessageResources messages = getResources(request);
        MessageForm messageForm = (MessageForm) form;
        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        ForumDAO dao = ForumDAO.getInstance();
        UserDAO userdao = UserDAO.getInstance();
        ActionErrors errors = new ActionErrors();
        StringBuffer forward = new StringBuffer();
        Configurator config = Configurator.getInstance();

        if ((user.getStatus() > 0)) {
View Full Code Here

        }

        // 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

     * @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

    /**
     * @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

    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

     * @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

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.