Package org.jresearch.gossip.beans.user

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


        try {
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getUserQueries().getSql_GET_USER_BY_ID());
            st.setInt(1, Integer.parseInt(uid));

            User user = new User();
            fillUser(st, user, false);
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getUserQueries().getSql_DELETE_USER());
            st.setInt(1, Integer.parseInt(uid));
            st.execute();
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getForumQueries().getSql_CLEAN_USER_MOD());
            st.setString(1, user.getName());
            st.execute();
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getForumQueries().getSql_CLEAN_USER_SUBSCR());
            st.setString(1, user.getName());
            st.execute();
            st = connection.prepareStatement(dbDriver.getQueries()
                    .getForumQueries().getSql_MARK_USER_MESS());
            st.setString(1, "<" + user.getName() + ">");
            st.setString(2, user.getName());
            st.execute();
        } finally {
            st.close();
            connection.close();
        }
View Full Code Here


     */
    public User getUser(String username, String password) throws SQLException {
        Connection connection = this.dataSource.getConnection();
        PreparedStatement st = connection.prepareStatement(dbDriver
                .getQueries().getUserQueries().getSql_GET_USER());
        User bean = new User();
        st.setString(1, username);
        st.setString(2, MD5Digest.digest(username, password));

        try {
            fillUser(st, bean);
View Full Code Here

    public User getUserEncoded(String username, String password)
            throws SQLException {
        Connection connection = this.dataSource.getConnection();
        PreparedStatement st = connection.prepareStatement(dbDriver
                .getQueries().getUserQueries().getSql_GET_USER_ENCODED());
        User bean = new User();
        st.setString(1, username);
        st.setString(2, password);

        try {
            fillUser(st, bean);
View Full Code Here

     */
    public User getUser(String username) throws SQLException {
        Connection connection = this.dataSource.getConnection();
        PreparedStatement st = connection.prepareStatement(dbDriver
                .getQueries().getUserQueries().getSql_GET_USER_INFO_FULL());
        User bean = new User();

        try {
            st.setString(1, username);
            fillUser(st, bean);
        } finally {
View Full Code Here

     */
    public User getUserInfo(String username) throws SQLException {
        Connection connection = this.dataSource.getConnection();
        PreparedStatement st = connection.prepareStatement(dbDriver
                .getQueries().getUserQueries().getSql_GET_USER_INFO_FULL());
        User bean = new User();

        try {
            st.setString(1, username);
            fillUser(st, bean, false);
        } finally {
View Full Code Here

        Connection connection = this.dataSource.getConnection();
        PreparedStatement st = connection.prepareStatement(dbDriver
                .getQueries().getUserQueries().getSql_CHECK_USER_WITH_EMAIL());
        ResultSet rs = null;
        String newpass = null;
        User user = new User();

        try {
            st.setString(1, email);
            st.setString(2, login);
            rs = (ResultSet) st.executeQuery();
            fillUser(st, user, false);

            if (user.getStatus() > 0) {
                newpass = generatePassword();
                st = connection.prepareStatement(dbDriver.getQueries()
                        .getUserQueries().getSql_CHANGE_PASSWORD());
                st.setString(1, MD5Digest.digest(login, newpass));
                st.setString(2, login);
                st.execute();
                user.setPassword(newpass);
            }
        } finally {
            if (rs != null) {
                rs.close();
            }
View Full Code Here

    public User getUserInfoShort(int uid) throws SQLException {
        Connection connection = this.dataSource.getConnection();
        PreparedStatement st = connection.prepareStatement(dbDriver
                .getQueries().getUserQueries().getSql_GET_USER_INFO_BY_ID());
        ResultSet rs = null;
        User bean = new User();

        try {
            st.setInt(1, uid);
            rs = st.executeQuery();

            if (rs.next()) {
                bean.setName(rs.getString("user_name"));
                bean.setStatus(rs.getInt("user_status"));
            }
        } finally {
            if (rs != null) {
                rs.close();
            }
View Full Code Here

            return (mapping.findForward(IConst.TOKEN.DENIED));
        }

        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()) {
                        Cookie userCookie = new Cookie(IConst.COOKIE.USER_COOKIE,
                                user.getName() + "*" + user.getPassword());
                        userCookie.setMaxAge(IConst.COOKIE.SECONDS_PER_YEAR);
                        ((HttpServletResponse) response).addCookie(userCookie);
                    }
                }

                user.setIp(request.getRemoteAddr());
                session.setAttribute(IConst.SESSION.USER_KEY, user);
                setStatusMessage(request, "status.CH_PASS");
            } else {
                ActionErrors errors = new ActionErrors();
                errors.add(ActionErrors.GLOBAL_ERROR,
View Full Code Here

     */
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        HttpSession session = request.getSession();
        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        ForumDAO dao = ForumDAO.getInstance();
        ProcessAttachForm paForm = (ProcessAttachForm) form;
        if (Configurator.getInstance().getBoolean(
                IConst.CONFIG.ENABLE_FILE_UPLOAD)) {
            FileData fData = dao
View Full Code Here

        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

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.