Package org.jresearch.gossip.forms

Examples of org.jresearch.gossip.forms.ProfileForm


        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());
                    session.setAttribute(IConst.SESSION.USER_KEY, newuser);
                    /*
                     * MailMessage(String messagetext, String subject, String
                     * addrfrom, String namefrom, String addrto, String nameto)
                     */
                    MessageResources messages = getResources(request);
                    Configurator config = Configurator.getInstance();

                    /*
                     * {0} - login {1} - new password {2} - site url {3} - site
                     * name
                     */
                    StringBuffer siteUrl = new StringBuffer();
                    siteUrl.append(request.getServerName());
                    siteUrl.append(":");
                    siteUrl.append(request.getServerPort());
                    siteUrl.append(request.getContextPath());
                    siteUrl.append(config.get(IConst.CONFIG.MODULE_PREFIX));
                    siteUrl.append("/");

                    Object[] messArgs = new Object[] { newuser.getName(),
                            profile.getPassword(), siteUrl.toString(),
                            config.get(IConst.CONFIG.SITE_NAME) };

                    MailQueue queue = (MailQueue) session.getServletContext()
                            .getAttribute(IConst.CONTEXT.MAIL_QUEUE);
                    queue.push(new MailMessage(messages.getMessage(
View Full Code Here


            throws JGossipException {
        HttpSession session = request.getSession();

        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        UserDAO dao = UserDAO.getInstance();
        ProfileForm pForm = (ProfileForm) form;
        String forward=IConst.TOKEN.PAGE;
        try {
            if (Configurator.getInstance().getBoolean(
                    IConst.CONFIG.ENABLE_EXT_SIGN_ON)
                    && !dao.isUserExist(user.getName())) {
                //add new forum user
                pForm.setLogin(user.getName());
                pForm.setPassword(user.getName());
                pForm.setPassword2(user.getName());
                dao.addUser(pForm);
                user = dao.getUser(pForm.getLogin(), pForm.getPassword());
                if (user.getStatus() == UserStatus.GUEST) {
                    session.setAttribute(IConst.SESSION.USER_KEY, user);
                    throw new LogicException(getResources(request).getMessage(
                            "errors.ERR22")
                            + user.getName());
View Full Code Here

        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

    public ActionForward process(ActionMapping mapping, ActionForm form,
            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

TOP

Related Classes of org.jresearch.gossip.forms.ProfileForm

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.